Sha256: f8513bb0a45ce04a9f63afec868e71c9a5b8df3f9e8e7848fc8340dad4b9deff
Contents?: true
Size: 451 Bytes
Versions: 9
Compression:
Stored size: 451 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_length_of :password, minimum: 8, allow_blank: true before_validation { self.email = email.downcase.strip } def as_json(options) super(options.merge(except: [:password_digest, :session_token])) end end
Version data entries
9 entries across 9 versions & 1 rubygems