person.rb 219 Bytes Edit Raw Blame History Permalink 1 2 3 4 5 6 7 8 9 require_dependency 'person' class Person scope :with_role, lambda { |role_id| { :select => 'DISTINCT profiles.*', :joins => :role_assignments, :conditions => ["role_assignments.role_id = #{role_id}"] } } end