diff --git a/bullet_train-super_scaffolding/app/models/scaffolding/absolutely_abstract/creative_concept.rb b/bullet_train-super_scaffolding/app/models/scaffolding/absolutely_abstract/creative_concept.rb index a4ae478f5..ca1a96999 100644 --- a/bullet_train-super_scaffolding/app/models/scaffolding/absolutely_abstract/creative_concept.rb +++ b/bullet_train-super_scaffolding/app/models/scaffolding/absolutely_abstract/creative_concept.rb @@ -4,7 +4,9 @@ class Scaffolding::AbsolutelyAbstract::CreativeConcept < ApplicationRecord belongs_to :team # 🚅 add belongs_to associations above. - has_many :completely_concrete_tangible_things, class_name: "Scaffolding::CompletelyConcrete::TangibleThing", foreign_key: :absolutely_abstract_creative_concept_id, dependent: :destroy + # TODO: We shouldn't have to explicitly set the order here, so we need to find out why these records + # are being returned in descending order when calling @creative_concept.completely_concrete_tangible_things. + has_many :completely_concrete_tangible_things, -> { order(:id) }, class_name: "Scaffolding::CompletelyConcrete::TangibleThing", foreign_key: :absolutely_abstract_creative_concept_id, dependent: :destroy has_many :collaborators, class_name: "Scaffolding::AbsolutelyAbstract::CreativeConcepts::Collaborator", dependent: :destroy, foreign_key: :creative_concept_id has_many :memberships, through: :collaborators # 🚅 add has_many associations above.