search for: rule_spac

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

Did you mean: rule_space
2006 May 12
1
can I fake has_one :through?
...a single RuleSpace. Going the other way, given a RuleSpace I should find many Subjects. I''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