Sha256: 830b7d372e0b64078a2f6292cf7b1f01e59fcfbaea280373d5b31c6af0d7cc4b

Contents?: true

Size: 563 Bytes

Versions: 6

Compression:

Stored size: 563 Bytes

Contents

class BrickLayer::Administrator
  include Mongoid::Document
  include ActiveModel::SecurePassword

  field :full_name,         type: String
  field :username,          type: String
  field :email,             type: String
  field :password_digest,   type: String

  has_secure_password

  attr_accessible :full_name, :email, :username, :password, :password_confirmation
  
  validates :username, :presence => true, :uniqueness => true

  def self.authenticate(username, password)
    where(:username => username).try(:first).try(:authenticate, password)
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
brick_layer-0.10.6 app/models/brick_layer/administrator.rb
brick_layer-0.10.5 app/models/brick_layer/administrator.rb
brick_layer-0.10.3 app/models/brick_layer/administrator.rb
brick_layer-0.10.2 app/models/brick_layer/administrator.rb
brick_layer-0.10.1 app/models/brick_layer/administrator.rb
brick_layer-0.10.0 app/models/brick_layer/administrator.rb