lib/place/project.rb
# Find all users involved in the project, eventually with a given role
Find all users involved in the project, eventually with a given role
Find all users involved in the project eventually with a given role
def users(with_role=nil)
    user_set = []
	if participations.size > 0
      participations.all.each do |pt|
	    unless with_role.nil?
  	      role = with_role.to_s
		  roles = pt.roles.size > 0 ? pt.roles.to_a : []
		  user_set << pt.user  if roles.include?(role)
	    else
  	      user_set << pt.user
	    end
	  end
	end
	user_set
  end
def users ( with_role = nil ) user_set = [ ] if participations . size > 0 participations . all . each do | pt | unless with_role . nil? role = with_role . to_s roles = pt . roles . size > 0 ? pt . roles . to_a : [ ] user_set << pt . user if roles . include? ( role ) else user_set << pt . user end end end user_set end
Find all users involved in the project, eventually with a given role
Find all users involved in the project eventually with a given role
with_role
<not_specific>