Fix for set_attribute_was patch issue and Rails 7 support #434
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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