1

型号:*人*俱乐部

关系 * 成员 * 委员会

人们应该能够加入俱乐部(会员) 人们应该能够成为俱乐部的董事会成员(委员会)

对于我的应用程序,这些涉及非常不同的功能,所以我不希望使用标志来设置 (is_board_member) 或类似的。

我发现自己想写:

人们 has_many :clubs :through => :membership # :as => :member? :foreign_key => :member_id? has_many :clubs :through => :committee # as (above)

但我不确定如何将它缝合在一起

4

1 回答 1

2

尝试

has_many :committee_clubs, :through => :committee, :source => :clubs
has_many :membership_clubs, :through => :membership, :source => :clubs
于 2010-06-04T08:42:44.163 回答