Module: RoleStrategy::MongoMapper::RoleStrings::ClassMethods
- Defined in:
- lib/roles_mongo_mapper/strategy/multi/role_strings.rb
Instance Method Summary collapse
Instance Method Details
#in_any_role(*role_names) ⇒ Object
22 23 24 25 26 27 28 |
# File 'lib/roles_mongo_mapper/strategy/multi/role_strings.rb', line 22 def in_any_role(*role_names) begin where(role_attribute.in => role_names.to_strings) rescue return [] end end |
#in_role(role_name) ⇒ Object
18 19 20 |
# File 'lib/roles_mongo_mapper/strategy/multi/role_strings.rb', line 18 def in_role(role_name) in_any_role(role_name) end |
#role_attribute ⇒ Object
14 15 16 |
# File 'lib/roles_mongo_mapper/strategy/multi/role_strings.rb', line 14 def role_attribute strategy_class.roles_attribute_name.to_sym end |