I have 3 models:
state_records, has_many :weight_categories
,weight_categories, has_many :lifts
,state_records, has_many :lifts, through: :weight_categories
The form for @state_record
includes both the creation of weight_categories
and lifts
via the cocoon gem. Each @weight_category
has 3 lifts but these lifts need to be in a specific order.
When I create the form everything is OK. When I update the form (only in production), occasionally the order of the lifts will change. I don't have anything in the code to define the order because I assumed it would order itself by created_at. Everything works fine in development but not in production. I assume it has something to do with having postgres as my production database and sqlite3 as my dev database.
I think I need to just define the order but don't know the best way to do this. Everything gets displayed through the State Record's model.