Skip to content

Commit

Permalink
Merge pull request #409 from bullet-train-co/fixes/tangible-thing-order
Browse files Browse the repository at this point in the history
Add temporary fix for `TangibleThing` order
  • Loading branch information
jagthedrummer authored Aug 17, 2023
2 parents 115370d + dd267ec commit f2d0844
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit f2d0844

Please sign in to comment.