How to do a Rails 3 join query?
I have the following model
class User < ActiveRecord::Base
has_many :assignments
has_many :roles, :through => :assignments
has_one :profile
end
How wou开发者_JAVA技巧ld I do and active record query to select profiles of users with a particular role?
.includes(:relation)
might be useful
精彩评论