Skip to content

Commit 64096bd

Browse files
authored
Fix, Use devise_will_save_change_to_email? method for email change detection (#1654)
* fix: Update method names to devise_will_save_change_to_email? * fix: Remove email_changed? method
1 parent c5109f7 commit 64096bd

2 files changed

Lines changed: 2 additions & 3 deletions

File tree

app/models/devise_token_auth/concerns/confirmable_support.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ module DeviseTokenAuth::Concerns::ConfirmableSupport
33

44
included do
55
# Override standard devise `postpone_email_change?` method
6-
# for not to use `will_save_change_to_email?` & `email_changed?` methods.
6+
# for not to use `devise_will_save_change_to_email?` methods.
77
def postpone_email_change?
88
postpone = self.class.reconfirmable &&
99
email_value_in_database != email &&

app/models/devise_token_auth/concerns/user.rb

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,7 @@ def self.tokens_match?(token_hash, token)
4141

4242
# don't use default devise email validation
4343
def email_required?; false; end
44-
def email_changed?; false; end
45-
def will_save_change_to_email?; false; end
44+
def devise_will_save_change_to_email?; false; end
4645

4746
if DeviseTokenAuth.send_confirmation_email && devise_modules.include?(:confirmable)
4847
include DeviseTokenAuth::Concerns::ConfirmableSupport

0 commit comments

Comments
 (0)