0
나는 내 응용 프로그램의 사용자 구조에 다음과 같은 간단한 그룹이 있습니다쿼리 및 레일의 많은 관계로 많은 관리
class Account < ActiveRecord::Base
has_many :account_membership
end
class Group < ActiveRecord::Base
has_many :account_membership
end
class AccountMembership < ActiveRecord::Base
belongs_to :account
belongs_to :group
end
지금 계정의 목록을 얻고, 싶은 모든 계정을 포함하는 그룹을 얻을를 (그리고 그것들 만).
ActiveRecord
쿼리로 수행 할 수있는 방법이 있습니까? 아니면 SQL을 사용해야합니까?
where 절에서 'account_memberships'여야합니다. 감사! 정말 잘해. – shem