Class: Administrator

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

Instance Method Summary collapse

Instance Method Details

#failed_attemptsObject

Lockable



17
# File 'app/models/administrator.rb', line 17

field :failed_attempts, :integer, :default => 0

#has_role?(role) ⇒ Boolean

Returns:

  • (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_countObject

Trackable



10
# File 'app/models/administrator.rb', line 10

field :sign_in_count, :as => :integer, :default => 0

#usernameObject

Database authenticatable



4
# File 'app/models/administrator.rb', line 4

field :username, :null => false, :default => "", :index => { :unique => true }