Sha256: 1f9dbd6180b6aef96e257daf2c452f7b2eb0eccb27e33635a640949e4cc6b8ee
Contents?: true
Size: 747 Bytes
Versions: 6
Compression:
Stored size: 747 Bytes
Contents
class <%= class_name %> < ApplicationRecord has_secure_password has_many :sessions, dependent: :destroy 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 do self.email = email.downcase.strip end after_create_commit do IdentityMailer.with(<%= singular_table_name %>: self).email_verify_confirmation.deliver_later end after_update_commit if: :email_previously_changed? do update_columns verified: false end after_update_commit if: :email_previously_changed? do IdentityMailer.with(<%= singular_table_name %>: self).email_verify_confirmation.deliver_later end end
Version data entries
6 entries across 6 versions & 1 rubygems