Class: Administrator
- Inherits:
-
ActiveRecord::Base
- Object
- ActiveRecord::Base
- Administrator
- Defined in:
- app/models/administrator.rb
Instance Method Summary collapse
-
#failed_attempts ⇒ Object
Lockable.
- #has_role?(role) ⇒ Boolean
-
#sign_in_count ⇒ Object
Trackable.
-
#username ⇒ Object
Database authenticatable.
Instance Method Details
#failed_attempts ⇒ Object
Lockable
17 |
# File 'app/models/administrator.rb', line 17 field :failed_attempts, :integer, :default => 0 |
#has_role?(role) ⇒ Boolean
24 25 26 |
# File 'app/models/administrator.rb', line 24 def has_role?(role) %w(administrator logged_in).include?( role.try(:to_s) ) ? true : false end |
#sign_in_count ⇒ Object
Trackable
10 |
# File 'app/models/administrator.rb', line 10 field :sign_in_count, :as => :integer, :default => 0 |
#username ⇒ Object
Database authenticatable
4 |
# File 'app/models/administrator.rb', line 4 field :username, :null => false, :default => "", :index => { :unique => true } |