Class: Elabs::User
- Inherits:
-
ApplicationRecord
- Object
- ActiveRecord::Base
- ApplicationRecord
- Elabs::User
- Includes:
- Concerns::Sluggable
- Defined in:
- app/models/elabs/user.rb
Direct Known Subclasses
Constant Summary collapse
- SLUGGABLE_FIELD =
nil
- SLUG_FIELD =
:username
Instance Attribute Summary
Attributes inherited from ApplicationRecord
Instance Method Summary collapse
Methods included from Concerns::Sluggable
Instance Method Details
#admin? ⇒ Boolean
37 38 39 |
# File 'app/models/elabs/user.rb', line 37 def admin? role == 'admin' end |
#display_name ⇒ Object
41 42 43 |
# File 'app/models/elabs/user.rb', line 41 def display_name real_name.present? ? real_name : "@#{username}" end |
#to_param ⇒ Object
45 46 47 |
# File 'app/models/elabs/user.rb', line 45 def to_param username end |