Module: RoleStrategy::ActiveRecord::OneRole::ClassMethods
- Defined in:
- lib/roles_active_record/strategy/single/one_role.rb
Instance Method Summary collapse
Instance Method Details
#in_any_role(*role_names) ⇒ Object
19 20 21 22 |
# File 'lib/roles_active_record/strategy/single/one_role.rb', line 19 def in_any_role(*role_names) matching_roles = Role.named(role_names) User.where(:role_id => matching_roles.map(&:id)) end |
#in_role(role_name) ⇒ Object
15 16 17 |
# File 'lib/roles_active_record/strategy/single/one_role.rb', line 15 def in_role(role_name) in_any_role(role_name) end |