Class: Georgia::User
- Inherits:
-
ActiveRecord::Base
- Object
- ActiveRecord::Base
- Georgia::User
- Defined in:
- app/models/georgia/user.rb
Instance Method Summary collapse
Instance Method Details
#has_role?(role) ⇒ Boolean
9 10 11 12 13 |
# File 'app/models/georgia/user.rb', line 9 def has_role? role return false unless role @role_names ||= roles.map(&:name) @role_names.include? role.to_s.titleize end |
#name ⇒ Object
18 19 20 |
# File 'app/models/georgia/user.rb', line 18 def name [first_name, last_name].join(' ') end |
#roles_names ⇒ Object
22 23 24 |
# File 'app/models/georgia/user.rb', line 22 def roles_names roles.map(&:name).join(', ') end |