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

Align as_json method (use args instead of kwargs) #4089

Merged
merged 2 commits into from
Feb 11, 2024

Conversation

orien
Copy link
Contributor

@orien orien commented Feb 9, 2024

Context

There's a change in Ruby 3.0 that separates positional and keyword arguments.

Change

Some Samson classes have the as_json method overridden. The method definition in the Rails superclass accepts an options hash argument. However, the method definition in the subclasses is changed to accept keyword arguments instead. This inconsistency won't work on Ruby 3.

In preparation for the Ruby 3.0 upgrade, align the subclass method definitions with the superclass by accepting an options hash argument instead of keyword arguments.

Considerations

This change is far from resolving all the args/kwargs issues when running on Ruby 3.0, but it's a safe start.

Copy link
Contributor

@grosser grosser left a comment

Choose a reason for hiding this comment

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

looks right 👍

@orien orien marked this pull request as ready for review February 9, 2024 01:27
@orien
Copy link
Contributor Author

orien commented Feb 11, 2024

Thanks @grosser. Could I please get your help to merge this PR as well?

@grosser grosser merged commit 3f63338 into zendesk:master Feb 11, 2024
9 checks passed
@orien orien deleted the ruby-3-prep branch February 12, 2024 00:25
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.

2 participants