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

Fix a deprecation warning in unique_generator.rb related to the kwargs change in Ruby 2.7. #1868

Merged
merged 4 commits into from
Dec 28, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions lib/helpers/unique_generator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@ def method_missing(name, *arguments)

raise RetryLimitExceeded, "Retry limit exceeded for #{name}"
end
# Have method_missing use ruby 2.x keywords if the method exists.
# This is necessary because the syntax for passing arguments (`...`)
# is invalid on versions before Ruby 2.7, so it can't be used.
ruby2_keywords(:method_missing) if respond_to?(:ruby2_keywords, true)
# rubocop:enable Style/MethodMissingSuper

def respond_to_missing?(method_name, include_private = false)
Expand Down