search for: main_entity_id

Displaying 1 result from an estimated 1 matches for "main_entity_id".

2006 Jun 11
0
Reaching through a belongs_to for acts_as_list scope?
...level). class MainEntity < AcrtiveRecord::Base has_many :containers end class Container < ActiveRecord::Base has_many :elements belongs_to :main_entity end class Elements < ActiveRecord::Base belong_to :containers acts_as_list :scope=> ??? # it wants to be container.main_entity_id end Now I''ve thought of two ways to solve this. 1. add main_entity_id to the Element -- this adds a redundant link in the DB, and I''d like to avoid that, but if this is the normal Rails solution, I guess I can live with it... 2. Something like acts_as_list :scope=...