Module: Devise::Models::MultiEmailConfirmable::ConfirmableExtensions

Extended by:
ActiveSupport::Concern
Defined in:
lib/devise/multi_email/models/confirmable.rb

Defined Under Namespace

Modules: ClassMethods

Instance Method Summary collapse

Instance Method Details

#active_for_authentication?Boolean

This need to be forwarded to the email that the user logged in with

Returns:

  • (Boolean)


55
56
57
58
59
60
61
62
63
# File 'lib/devise/multi_email/models/confirmable.rb', line 55

def active_for_authentication?
   = multi_email.

  if  && !.primary?
    super && .active_for_authentication?
  else
    super
  end
end

#email=(new_email) ⇒ Object

In case email updates are being postponed, don’t change anything when the postpone feature tries to switch things back



50
51
52
# File 'lib/devise/multi_email/models/confirmable.rb', line 50

def email=(new_email)
  multi_email.change_primary_email_to(new_email, allow_unconfirmed: unconfirmed_access_possible?)
end

#inactive_messageObject

Shows email not confirmed instead of account inactive when the email that user used to login is not confirmed



66
67
68
69
70
71
72
73
74
# File 'lib/devise/multi_email/models/confirmable.rb', line 66

def inactive_message
   = multi_email.

  if  && !.primary? && !.confirmed?
    :unconfirmed
  else
    super
  end
end