-
Notifications
You must be signed in to change notification settings - Fork 425
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 for set_attribute_was patch issue and Rails 7 support #434
Conversation
Signed-off-by: Josh Branham <[email protected]>
…pted into set-attribute-was-restriction
As those should be passing or otherwise dealt with by the time this is merged
…r Rails >= 5.2 Use #write_cast_value instead of #set_attribute_was patch
… with Rails 7 Prefix 'attr_encrypted' to encrypt and decrypt methods to avoid clash with Rails 7 Adopted from PR: attr-encrypted#425
The checks are failing for only Ruby 2.6.10. Caused by:
Tests for all versions of Rails, with Ruby 2.7.6 are passing in Travis Please feel free to suggest a solution for this. |
…removed native gem support for Ruby 2.6
sqlite3 v1.6.0 and above removed the native gem support for ruby 2.6: sparklemotion/sqlite3-ruby#367 . So I am hardcoding the sqlite3 version to 1.5.4 in We can also think about dropping the support for ruby 2.6 All the tests are passing now. |
Thanks @vimalvnair this looks great to me. @mvastola any concerns? |
When this gets merged (hopefully soon 🎉 ), will this be packaged into a release right after? :-) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Thanks for doing this, all!
Thank you @mvastola @joshbranham for looking into this. |
@mvastola @joshbranham Can we also package this into a release? |
Resolves #425 @vimalvnair working on it in #435 |
As of version 4.0.0, attr_encrypted supports Rails 7. This change relaxes the version requirement for attr_encrypted so that there's a path to upgrade to Rails 7 while staying in the `devise-two-factor` 4.x series, for apps who are ready for the Rails update but not yet ready for the `devise-two-factor` 5.x update. Relevant attr_encrypted version: attr-encrypted/attr_encrypted@b565876 Rails 7 changes: attr-encrypted/attr_encrypted#434
This fixes the issue mentioned in PR: #431 , created by @mvastola
I am using the
write_cast_value
method from ActiveModel instead of the removedset_attribute_was
to manage virtual attributes. This will work for Rails version 5.2 and higher. I locally ran the tests for all the rails versions mentioned in travis.yml and the tests are passing for all. I couldn't find a way to push the fix to the above PR, some I am creating a new one.I have tested the fix with our internal app and have not encountered any issues. However, I recommend that others also test it with their applications.
I have also included the changes for Rails 7 support which fixes #423 . These changes were taken from PR: #425, created by @movermeyer. I couldn't find a way to contribute to that. I suggest reviewing the PR and the conversations there for additional context.
After these changes
attr_encrypted
should start working with Rails 7