lib/devise/multi_email/models/confirmable.rb in devise-multi_email-2.0.1 vs lib/devise/multi_email/models/confirmable.rb in devise-multi_email-3.0.0
- old
+ new
@@ -40,16 +40,16 @@
multi_email_association.include_module(EmailConfirmable)
end
# delegate before creating overriding methods
delegate :skip_confirmation!, :skip_confirmation_notification!, :skip_reconfirmation!, :confirmation_required?,
- :confirmation_token, :confirmed_at, :confirmation_sent_at, :confirm, :confirmed?, :unconfirmed_email,
- :reconfirmation_required?, :pending_reconfirmation?, to: :primary_email_record, allow_nil: true
+ :confirmation_token, :confirmed_at, :confirmed_at=, :confirmation_sent_at, :confirm, :confirmed?, :unconfirmed_email,
+ :reconfirmation_required?, :pending_reconfirmation?, to: Devise::MultiEmail.primary_email_method_name, allow_nil: true
# In case email updates are being postponed, don't change anything
# when the postpone feature tries to switch things back
def email=(new_email)
- multi_email.change_primary_email_to(new_email, allow_unconfirmed: false)
+ multi_email.change_primary_email_to(new_email, allow_unconfirmed: Devise.allow_unconfirmed_access_for > 0.days)
end
# This need to be forwarded to the email that the user logged in with
def active_for_authentication?
login_email = multi_email.login_email_record