Sha256: c3fad4fe56803e90d73638b57c0a93f3bdef70e90c474619361ac238858afe91

Contents?: true

Size: 343 Bytes

Versions: 4

Compression:

Stored size: 343 Bytes

Contents

class <%= class_name %> < ApplicationRecord
  has_secure_password :password
  has_secure_token :session_token

  validates :email, presence: true, uniqueness: true
  validates :email, format: { with: /\A[^@\s]+@[^@\s]+\z/ }
  validates :password, length: 8..70, allow_blank: true

  before_validation { self.email = email.downcase.strip }
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
authentication-zero-0.0.4 lib/generators/authentication/templates/models/resource.rb.tt
authentication-zero-0.0.3 lib/generators/authentication/templates/models/resource.rb.tt
authentication-zero-0.0.2 lib/generators/authentication/templates/models/resource.rb.tt
authentication-zero-0.0.1 lib/generators/authentication/templates/models/resource.rb.tt