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