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 the method Grape::Entity#exec_with_object to work with Ruby 3 #376

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

linhchauatx
Copy link

Fix the method Grape::Entity#exec_with_object to work with Ruby 3.

@dblock
Copy link
Member

dblock commented Jul 27, 2023

We already have Ruby 3.x in the CI. Are we missing tests? (Add part of this PR please)?

Don't worry about versions, revert that.

@@ -523,6 +523,7 @@ def exec_with_object(options, &block)
# it handles: https://github.com/ruby/ruby/blob/v3_0_0_preview1/NEWS.md#language-changes point 3, Proc
# accounting for expose :foo, &:bar
if e.is_a?(ArgumentError) && block.parameters == [[:req], [:rest]]
Rails.logger.error("***** ERROR in exec_with_object: #{e.message}\n#{e.backtrace.join("\n")}")
Copy link
Member

Choose a reason for hiding this comment

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

Not everyone uses Rails.

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