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 keyword delegation in form component #318

Merged
merged 2 commits into from
Feb 7, 2022

Conversation

deivid-rodriguez
Copy link
Member

Trying to fix #312.

We added `ruby2_keywords` in other `method_missing` delegations, but not
here.
Copy link
Member

@javierjulio javierjulio left a comment

Choose a reason for hiding this comment

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

Totally missed that when reviewing the file beforehand. Thanks a lot! 🙌🏻 Do you see a need to create a test for this or release as is and then just drop Ruby 2.6 support? My understanding is that ruby2_keywords is needed for Ruby 2.6 and below but I could be mistaken.

@deivid-rodriguez
Copy link
Member Author

I think we can ship this as is and trust the test you added on the activeadmin side to verify it works as expected.

My understanding is that ruby2_keywords is needed for Ruby 2.7, and that once we drop support for that we can use explicit delegation of each arg type like

def method_missing(method, *args, **kwargs, &block)
  if form_builder && form_builder.respond_to?(method)
    proxy_call_to_form(method, *args, **kwargs, &block)
  else
    super
  end
end

Copy link
Member

@Fivell Fivell left a comment

Choose a reason for hiding this comment

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

❤️

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.

Ruby 3 Bug image_pack_tag "wrong number of arguments (given 2, expected 1)"
3 participants