Closed kaiserbrito closed 2 years ago
@reidmorrison Can you merge this PR? This fixes the method name conflict with the newer version of rails.
Hey @reidmorrison Any chance that you have sometime to merge this PR. This PR fixes the method name conflict with rails 7. Let me know if you need any help with this. Thanks.
Unfortunately, this is a breaking change which means we need a new major release to implement it. I know it will break our applications that use this method.
Ok, figured out a solution. With Rails 7, it now removes the old attributes_encrypted approach entirely.
# Remove old way of defining attributes with Rails 7 since it conflicts with the method names.
if ActiveRecord.version <= Gem::Version.new("7.0.0")
ActiveRecord::Base.include(SymmetricEncryption::ActiveRecord::AttrEncrypted)
end
So for Rails 7 and above we need to upgrade to the new Active Record Attributes API. See https://encryption.rocketjob.io/frameworks.html
This change is in v4.5.0. Let me know if this works for you?
Please re-open if the change above does not address the issue.
with v4.5.0, I am still getting method_missing': undefined method
attr_encrypted.
I use Rails 7.0.1 with symmetric-encryption v4.5.0. Is there any workaround here?
I have used it as below
attr_encrypted :authentication_token in my User model.
Correct, attr_encrypted
is no longer available when using Rails 7. The newer approach is documented here: https://encryption.rocketjob.io/frameworks.html.
Issue # (if available)
Description of changes
Replaced method
encrypted_attributes
forsymmetric_encrypted_attributes
to avoid conflicts when upgrading Rails to version 7, which has an implementation of this methodencrypted_attributes
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.