Skip to content

Fix, Use devise_will_save_change_to_email? method for email change detection #1654

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

hnegishi
Copy link

@hnegishi hnegishi commented May 20, 2025

Changes in this PR

This aligns with changes in devise.

  • Change will_save_change_to_email? = false to devise_will_save_change_to_email? = false
  • Remove email_changed? = false

Background

In the devise gem, the devise_will_save_change_to_email? method was introduced as a wrapper around will_save_change_to_email? or email_changed? to accommodate changes in dirty tracking. (Changed)

As a result, email validation in devise has also been updated to use devise_will_save_change_to_email?.

After that, only the devise_will_save_change_to_email? method, which wrapped email_changed?, was removed. Drop support to EOL rubies and Rails#5600.

For more details, please refer to the following devise Pull Request:
heartcombo/devise#5575
heartcombo/devise#5600

Effect

There are no behavioral changes introduced by this update.

  • devise_token_auth does not use devise's email validation.
  • Internally, devise_will_save_change_to_email? simply calls will_save_change_to_email?.

I would like to take this opportunity to thank the maintainers❤️

@hnegishi hnegishi changed the title fix: Update method names to devise_will_save_change_to_email? fix: Integrate into devise_will_save_change_to_email? method May 20, 2025
@hnegishi hnegishi changed the title fix: Integrate into devise_will_save_change_to_email? method Fix, Use devise_will_save_change_to_email? method for email change detection May 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant