app/models/users/unit.rb
def users_in_role(role)
    role = Role.find_by_name(role.to_s) unless role.is_a?(Role)
    return [] if role.nil?
    roles.find(:all, :conditions => { :role_id => role.id })
  end
# Returns the users from this unit that have the specified role. +role+ can be a string, a symbol, or an actual Role object.
# If the Role can't be found, return an empty Array. Otherwise, return an array of the users in the role.
Returns the users from this unit that have the specified role. +role+ can be a string, a symbol, or an actual Role object.
If the Role can't be found, return an empty Array. Otherwise, return an array of the users in the role.
Returns the users from this unit that have the specified role . + role + can be a string a symbol or an actual Role object . If the Role can ' t be found return an empty Array . Otherwise return an array of the users in the role .
def users_in_role(role)
    role = Role.find_by_name(role.to_s) unless role.is_a?(Role)
    return [] if role.nil?
    roles.find(:all, :conditions => { :role_id => role.id })
  end
def users_in_role ( role ) role = Role . find_by_name ( role . to_s ) unless role . is_a? ( Role ) return [ ] if role . nil? roles . find ( :all , :conditions => { :role_id => role . id } ) end
Returns the users from this unit that have the specified role.
Returns the users from this unit that have the specified role .
role