Module: RoleStrategy::ActiveRecord::AdminFlag::ClassMethods
- Defined in:
- lib/roles_active_record/strategy/single/admin_flag.rb
Instance Method Summary collapse
Instance Method Details
#in_role(role_name) ⇒ Object
18 19 20 21 22 23 24 25 |
# File 'lib/roles_active_record/strategy/single/admin_flag.rb', line 18 def in_role(role_name) case role_name.downcase.to_sym when :admin where(role_attribute => true) else where(role_attribute => false) end end |
#role_attribute ⇒ Object
14 15 16 |
# File 'lib/roles_active_record/strategy/single/admin_flag.rb', line 14 def role_attribute strategy_class.roles_attribute_name.to_sym end |