私はグループのモデルhas_many機関と学校を持っています。だから何が、私がすべき明らかにこれが不可能なユーザーとのグループの直接の関連
class Group
has_many :institutions
has_many :users, :through => :instiutions
has_many :schools
has_many :users, :through => :schools
end
class School
belongs_to :group
has_many :educations
has_many :users, :through => :educations
end
class Institution
belongs_to :group
has_many :institutional_educations
has_many :users, :through => :institutional_educations
end
:ユーザーをしかし、私はこのような機関や学校を通じて関連付けられているすべてのユーザをしたい:私はhave_and_belongs_to_manyする私のグループを必要とするしかし
class Group
has_many :institutions
has_many :schools
end
行う?
あなたの施設と学校のモデルはどのように定義されていますか? – shingara