Rails has_many :through PG::Error: ERROR: column reference "id" is ambiguous error
Try this:
default_scope { order('collections.id ASC') } //collection.rb
default_scope { order('components.id ASC') } //component.rb
When you perform a join
ascending on id
becomes ambiguous
column because both components
and collections
have id
column. It will not know which to use.