Class: SimpleUser::AdminUser

Inherits:
ActiveRecord::Base
  • Object
show all
Defined in:
app/models/simple_user/admin_user.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#temporal_rolesObject

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

Returns:

  • (Boolean)


39
40
41
# File 'app/models/simple_user/admin_user.rb', line 39

def banned?
  !active
end

#get_rolesObject



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