person.rb 196 Bytes Edit Raw Blame History Permalink 1 2 3 4 5 6 7 8 9 10 require_dependency 'person' class Person scope :with_role, -> role_id { select('DISTINCT profiles.*').joins(:role_assignments). where("role_assignments.role_id = #{role_id}") } end