Skip to content
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

fix mongoid detecting bug #1478

Merged
merged 3 commits into from
May 12, 2021

Conversation

qiuyin
Copy link
Contributor

@qiuyin qiuyin commented Apr 24, 2021

issue

This will always return string "expression" even when I don't use Mongoid.

defined?('Mongoid')

@qiuyin qiuyin marked this pull request as draft April 24, 2021 12:55
@qiuyin
Copy link
Contributor Author

qiuyin commented Apr 30, 2021

@MaicolBen Thanks for your approving.
I am newbie for this gem. Could you tell me how to run the test local and why the test is failing now

@MaicolBen
Copy link
Collaborator

@qiuyin I believe this was a false positive, I don't know how to rerun it, can you rebase/push again?

@qiuyin qiuyin marked this pull request as ready for review May 9, 2021 13:44
@qiuyin qiuyin force-pushed the fix-detect-Mongoid-bug branch from 772424e to 419d686 Compare May 9, 2021 13:46
On rails 6, if change password, in `before_save` callback
- `saved_change_to_attribute?(:encrypted_password)` return false
- `encrypted_password_changed?` return true
DeviseTokenAuth.remove_tokens_after_password_reset
else
saved_change_to_attribute?(:encrypted_password) &&
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

saved_change_to_attribute?

  • will return false in before_save callback
  • will return true in after_save callback

But encrypted_password_changed? is opposite to saved_change_to_attribute?
So we must use encrypted_password_changed?

@qiuyin
Copy link
Contributor Author

qiuyin commented May 10, 2021

@MaicolBen I have fixed the failed test, Could you review again.
#1478 (comment)

@MaicolBen MaicolBen merged commit 7d21928 into lynndylanhurley:master May 12, 2021
@qiuyin qiuyin deleted the fix-detect-Mongoid-bug branch May 13, 2021 06:27
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.

2 participants