Class: SimpleUser::AdminUser
- Inherits:
-
ActiveRecord::Base
- Object
- ActiveRecord::Base
- SimpleUser::AdminUser
- Defined in:
- app/models/simple_user/admin_user.rb
Instance Attribute Summary collapse
-
#temporal_roles ⇒ Object
Returns the value of attribute temporal_roles.
Class Method Summary collapse
Instance Method Summary collapse
Instance Attribute Details
#temporal_roles ⇒ Object
Returns the value of attribute temporal_roles.
30 31 32 |
# File 'app/models/simple_user/admin_user.rb', line 30 def temporal_roles @temporal_roles end |
Class Method Details
.get_editable_admins_except(admin_id) ⇒ Object
43 44 45 |
# File 'app/models/simple_user/admin_user.rb', line 43 def self.get_editable_admins_except(admin_id) joins(:roles).where("roles.name <> ? AND simple_user_admin_users.id <> ?", "admin", admin_id).group(:id) end |
Instance Method Details
#banned? ⇒ Boolean
39 40 41 |
# File 'app/models/simple_user/admin_user.rb', line 39 def banned? !active end |
#get_roles ⇒ Object
35 36 37 |
# File 'app/models/simple_user/admin_user.rb', line 35 def get_roles @temporal_roles = roles.collect{ |role| role.name }.join(", ") end |