Module: ReviseAuth::Model

Extended by:
ActiveSupport::Concern
Defined in:
lib/revise_auth/model.rb

Instance Method Summary collapse

Instance Method Details

#confirm_email_changeObject



39
40
41
# File 'lib/revise_auth/model.rb', line 39

def confirm_email_change
  update(confirmed_at: Time.current, email: unconfirmed_email, unconfirmed_email: nil)
end

#send_confirmation_instructionsObject

Generates a confirmation token and send email to the user



28
29
30
31
# File 'lib/revise_auth/model.rb', line 28

def send_confirmation_instructions
  token = generate_token_for(:email_verification)
  ReviseAuth::Mailer.with(user: self, token: token).confirm_email.deliver_later
end

#send_password_reset_instructionsObject

Generates a password reset token and send email to the user



34
35
36
37
# File 'lib/revise_auth/model.rb', line 34

def send_password_reset_instructions
  token = generate_token_for(:password_reset)
  ReviseAuth::Mailer.with(user: self, token: token).password_reset.deliver_later
end