Sha256: eca084d132650361f7c3571c71626bfc668c7cc2b155e6a4461f2356bfbefb54

Contents?: true

Size: 465 Bytes

Versions: 9

Compression:

Stored size: 465 Bytes

Contents

class AdminUser < ApplicationRecord
  include SpreadsheetArchitect

  has_secure_password

  validates :email, presence: true, uniqueness: true
  validates_format_of :email, with: /\A[^@\s]+@[^@\s]+\z/

  validates_length_of :password, minimum: 12, allow_nil: true
  validates_format_of :password, with: /(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])/, allow_nil: true, message: "might easily be guessed"

  before_validation do
    self.email = email.downcase.strip
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
administration-zero-0.0.9 lib/generators/admin/install/templates/models/admin_user.rb
administration-zero-0.0.8 lib/generators/admin/install/templates/models/admin_user.rb
administration-zero-0.0.7 lib/generators/admin/install/templates/models/admin_user.rb
administration-zero-0.0.6 lib/generators/admin/install/templates/models/admin_user.rb
administration-zero-0.0.5 lib/generators/admin/install/templates/models/admin_user.rb
administration-zero-0.0.4 lib/generators/admin/install/templates/models/admin_user.rb
administration-zero-0.0.3 lib/generators/admin/install/templates/models/admin_user.rb
administration-zero-0.0.2 lib/generators/admin/install/templates/models/admin_user.rb
administration-zero-0.0.1 lib/generators/admin/install/templates/models/admin_user.rb