Class: Fae::User
- Inherits:
-
ActiveRecord::Base
- Object
- ActiveRecord::Base
- Fae::User
- Includes:
- BaseModelConcern, UserConcern
- Defined in:
- app/models/fae/user.rb
Instance Attribute Summary
Attributes included from BaseModelConcern
Instance Method Summary collapse
-
#active_for_authentication? ⇒ Boolean
Called by Devise to see if an user can currently be signed in.
- #admin? ⇒ Boolean
- #fae_tracker_blacklist ⇒ Object
- #full_name ⇒ Object
-
#inactive_message ⇒ Object
Called by Devise to get the proper error message when an user cannot be signed in.
- #super_admin? ⇒ Boolean
- #super_admin_or_admin? ⇒ Boolean
- #user? ⇒ Boolean
Instance Method Details
#active_for_authentication? ⇒ Boolean
Called by Devise to see if an user can currently be signed in
55 56 57 |
# File 'app/models/fae/user.rb', line 55 def active_for_authentication? active? && super end |
#admin? ⇒ Boolean
38 39 40 |
# File 'app/models/fae/user.rb', line 38 def admin? role.name == 'admin' end |
#fae_tracker_blacklist ⇒ Object
64 65 66 |
# File 'app/models/fae/user.rb', line 64 def fae_tracker_blacklist [:reset_password_token, :reset_password_sent_at, :remember_created_at, :sign_in_count, :current_sign_in_at, :last_sign_in_at, :current_sign_in_ip, :last_sign_in_ip, :confirmation_token, :confirmed_at, :confirmation_sent_at, :unconfirmed_email, :failed_attempts, :unlock_token, :locked_at] end |
#full_name ⇒ Object
50 51 52 |
# File 'app/models/fae/user.rb', line 50 def full_name "#{first_name} #{last_name}" end |
#inactive_message ⇒ Object
Called by Devise to get the proper error message when an user cannot be signed in
60 61 62 |
# File 'app/models/fae/user.rb', line 60 def !active? ? :inactive : super end |
#super_admin? ⇒ Boolean
34 35 36 |
# File 'app/models/fae/user.rb', line 34 def super_admin? role.name == 'super admin' end |
#super_admin_or_admin? ⇒ Boolean
46 47 48 |
# File 'app/models/fae/user.rb', line 46 def super_admin_or_admin? super_admin? || admin? end |
#user? ⇒ Boolean
42 43 44 |
# File 'app/models/fae/user.rb', line 42 def user? role.name == 'user' end |