我有以下型号
class User < ActiveRecord::Base
has_many :assignments
has_many :roles, :through => :assignments
has_one :profile
end
我将如何做和主动记录查询来选择具有特定角色的用户的个人资料?
我有以下型号
class User < ActiveRecord::Base
has_many :assignments
has_many :roles, :through => :assignments
has_one :profile
end
我将如何做和主动记录查询来选择具有特定角色的用户的个人资料?