我authentications
有很多用作primary_key和groups
foreign_key ,没问题。uid
organizer_id
但uid
在属性范围内是唯一的provider
。我想确保我的关联只获取groups
where authentication.provider == 'meetup'
。我试过了:
has_many :groups, :primary_key => "uid", :foreign_key => "organizer_id", :conditions => {:provider => "meetup"}
但这只是试图找到groups
所有provider == "meetup"
如何在主表上指定条件authentications
?