Module: ReviseAuth::Model

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

Instance Method Summary collapse

Instance Method Details

#confirm_email_changeObject



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

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

#send_confirmation_instructionsObject

Generates a confirmation token and send email to the user



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

def send_confirmation_instructions
  # = breaks the query params
  token = generate_token_for.delete("=")
  self.confirmation_token = token
  save!
  ReviseAuth::Mailer.with(user: unconfirmed_email, token: token).confirm_email.deliver_later
end