Module: ActiveAuthentication::Model::Confirmable
- Extended by:
- ActiveSupport::Concern
- Defined in:
- lib/active_authentication/model/confirmable.rb
Instance Method Summary collapse
- #confirm ⇒ Object
- #send_email_confirmation_instructions ⇒ Object
- #send_email_confirmation_instructions? ⇒ Boolean
- #unconfirmed? ⇒ Boolean
Instance Method Details
#confirm ⇒ Object
22 23 24 25 26 27 |
# File 'lib/active_authentication/model/confirmable.rb', line 22 def confirm @send_email_confirmation_instructions = false @set_unconfirmed_email = false update email: unconfirmed_email, unconfirmed_email: nil end |
#send_email_confirmation_instructions ⇒ Object
29 30 31 32 |
# File 'lib/active_authentication/model/confirmable.rb', line 29 def send_email_confirmation_instructions token = generate_token_for :email_confirmation ActiveAuthentication::Mailer.with(token: token, user: self).email_confirmation_instructions.deliver end |
#send_email_confirmation_instructions? ⇒ Boolean
34 35 36 |
# File 'lib/active_authentication/model/confirmable.rb', line 34 def send_email_confirmation_instructions? @send_email_confirmation_instructions && unconfirmed_email.present? end |
#unconfirmed? ⇒ Boolean
38 39 40 |
# File 'lib/active_authentication/model/confirmable.rb', line 38 def unconfirmed? unconfirmed_email.present? end |