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

Add support for Ruby 2.7 and its kwargs #383

Merged
merged 1 commit into from Oct 19, 2022

Conversation

igor-drozdov
Copy link
Contributor

In Ruby 3.0, positional arguments and keyword arguments will be separated. Ruby 2.7 will warn for behaviors that will change in Ruby 3.0.

@igor-drozdov
Copy link
Contributor Author

@saghaulor wdyt about these changes? could you please have a look?

We can just fix the kwargs warning in this PR and continue the discussion on testing against Ruby versions in #364

@benguillet
Copy link

Hitting this problem now when upgrading to ruby 3. Thanks for the fix @igor-drozdov! Would be awesome to merge this

@igor-drozdov
Copy link
Contributor Author

@benguillet the project seems to be not actively maintained 😓 the workaround we went for in this particular case was using attribute_changed?(attr) directly on attr encrypted fields instead of using the #{attr}_changed? helpers. Hope it will help you as well!

@benguillet
Copy link

benguillet commented Apr 12, 2021

That's smart! I ended up forking the gem to implement your fix and it's working great. I think eventually we'll move to the new rails 7 included way of encrypting fields, but for now it does the trick!

@kuahyeow
Copy link

@mvastola Are you the new maintainer ? Perhaps you can help look at this PR ?

@joshbranham
Copy link
Member

@igor-drozdov would you like to rebase master onto your branch and just fix the one kwarg deprecation? Master should be in a passing state now and tests Ruby 2.6 and 2.7.

If not let me know and I can open a PR as well, but want to give you a chance. I know it has been a while!

In Ruby 3.0, positional arguments and keyword arguments will be
separated. Ruby 2.7 will warn for behaviors that will change in Ruby
3.0.
Copy link
Member

@joshbranham joshbranham left a comment

Choose a reason for hiding this comment

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

Thanks @igor-drozdov

This is ready for merge @mvastola

@igor-drozdov
Copy link
Contributor Author

@joshbranham thanks for reviewing!

@joshbranham joshbranham merged commit 4ec77d3 into attr-encrypted:master Oct 19, 2022
zackreverb pushed a commit to reverbdotcom/attr_encrypted that referenced this pull request Feb 17, 2023
In Ruby 3.0, positional arguments and keyword arguments will be
separated. Ruby 2.7 will warn for behaviors that will change in Ruby
3.0.

Co-authored-by: Igor Drozdov <idrozdov@gitlab.com>
WillRogers727 pushed a commit to CharlieHR/attr_encrypted that referenced this pull request Feb 27, 2023
In Ruby 3.0, positional arguments and keyword arguments will be
separated. Ruby 2.7 will warn for behaviors that will change in Ruby
3.0.

Co-authored-by: Igor Drozdov <idrozdov@gitlab.com>
pdoulatshahi pushed a commit to simplepractice/attr_encrypted that referenced this pull request Apr 4, 2023
In Ruby 3.0, positional arguments and keyword arguments will be
separated. Ruby 2.7 will warn for behaviors that will change in Ruby
3.0.

Co-authored-by: Igor Drozdov <idrozdov@gitlab.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants