Sha256: 488bbff814ae44bd86e509d03366b3665bd501f3a52624c5f1397df8b88cf192

Contents?: true

Size: 648 Bytes

Versions: 5

Compression:

Stored size: 648 Bytes

Contents

module Cally
  class User < ActiveRecord::Base
 
    has_secure_password
    before_save { self.email = email.downcase }
    before_save { self.security_answer = security_answer.downcase }
    validates :username, presence: true, length: { minimum: 3, maximum: 25 }, uniqueness: { case_sensitive: false }
    validates :email, presence: true, uniqueness: { case_sensitive: false }, format: { with: /\A[\w+\-.]+@[a-z\d\-.]+\.[a-z]+\z/i }
    validates :password, length: { minimum: 15 }, allow_nil: true
    validates :security_question, presence: true
    validates :security_answer, presence: true, uniqueness: { case_sensitive: false }
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
cally-2.0.0 app/models/cally/user.rb
cally-1.0.3 app/models/cally/user.rb
cally-1.0.2 app/models/cally/user.rb
cally-1.0.1 app/models/cally/user.rb
cally-1.0.0 app/models/cally/user.rb