-
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
Rails 7 support #425
Rails 7 support #425
Conversation
Prefixes our encrypted_attributes with library specific attr_encrypted so we are not clashing with the Rails 7.0 definition of encrypted_attributes
b7310b2
to
ee35c84
Compare
Prefix encrypt and decrypt methods with attr_encrypted so we don't clash with rails 7
ee35c84
to
4f33ddb
Compare
Can you add rails 6 and 7 to the test matrix? |
I think we'll need a smarter matrix. Rails 7 isn't compatible with ruby <3.1. |
@xjunior Also might be a good time to migrate to GitHub Actions? |
Also, it seems that |
Hi @movermeyer, is there any workaround that you suggest we could try here? |
For what it's worth, this at least appears to work. |
True, we could probably look at this patch to fix the |
From what I can see >= 2.7 is fine: |
I was working with @mvastola but have been a bit busy. The idea was to cut a new major release for this breaking change and let rails 7 users upgrade. There is some discussion around how much we should maintain previous versions of this library for older Ruby and ActiveRecord versions. Fwiw we are using this exact patch on a fork at my company to get onto Rails 7, then figuring out how to migrate the data and move to native Rails encryption. |
Hi @joshbranham! First, thanks for your awesome work 👍 Do you have any idea when this could be released, to upgrade to Rails 7? Thanks |
The current blocker is I haven't had much luck understanding why those tests exist, and if anyone is using |
… with Rails 7 Prefix 'attr_encrypted' to encrypt and decrypt methods to avoid clash with Rails 7 Adopted from PR: attr-encrypted#425
… with Rails 7 Prefix 'attr_encrypted' to encrypt and decrypt methods to avoid clash with Rails 7 Adopted from PR: #425
What are you trying to accomplish?
Fixes #423.
Rails 7 introduced Active Record Encryption, which has names that collide with the names that
attr_encrypted
is using.What approach did you choose and why?
I took over @ryosk7, @kineca, and @armiiller's closed PR, rebased it on latest
master
, and recreated it here.It's a simple rename of class variables and methods, adding a
attr_encrypted_
prefix to each.IMO, it's a perfectly cromulent rename.
What should reviewers focus on?
This is a breaking change, since anyone relying on these names will have to update their code.
The impact of these changes
attr_encrypted
will work once again on Rails 7