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

Use kwargs instead of hash for options argument #13

Merged
merged 1 commit into from
Feb 4, 2022

Conversation

leonid-shevtsov
Copy link

@leonid-shevtsov leonid-shevtsov commented Jan 10, 2022

The options hash argument has been deprecated since Ruby 2.7, and replaced by keyword arguments in Rails code for roughly 3 years (see commit rails/rails@b57ca84, for example).

After upgrading from Ruby 2.7 to 3.1, our migrations stopped working entirely, because Ruby 3.1 (or maybe 3.0 too) won't allow you calling a super with kwargs from a method with a hash argument.

The solution is to match Rails code and use kwargs.

@clarkedb
Copy link

clarkedb commented Feb 4, 2022

@kwent could this be added in the next version of this gem?

@kwent kwent merged commit f83a9b7 into kwent:master Feb 4, 2022
@kwent
Copy link
Owner

kwent commented Feb 4, 2022

@clarkedb Done !

@leonid-shevtsov leonid-shevtsov deleted the ruby-3.1-compat branch February 7, 2022 10:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants