search for: rule_spaces

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

2006 May 12
1
can I fake has_one :through?
...9;'m thinking the model definitions should look like this: class RuleSpace < AR::Base has_many :rules has_many :subjects, :through => :rules end class Rule < AR::Base belongs_to :rule_space belongs_to :subject end class Subject < AR::Base has_one :rule has_many :rule_spaces, :through => :rules end I''m not sure at all that a call to Subject.rule_spaces will return only a single element. Will #has_one enforce this? Is this legal? cr