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

Handle string field names in CustomFieldList#respond_to? #606

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

cgunther
Copy link
Contributor

@cgunther cgunther commented Mar 6, 2024

Previously respond_to? assumed it was given a symbol argument, so it directly checked for that argument in the fields, which are force-keyed as symbols. If you passed it a string argument, it wouldn't find the corresponding field, impying it didn't respond to such a method.

Now, the argument is explicitly cast to a symbol before checking if such a field exists, supporting checking respond_to? with both argument types.

Previously `respond_to?` assumed it was given a symbol argument, so it
directly checked for that argument in the fields, which are force-keyed
as symbols. If you passed it a string argument, it wouldn't find the
corresponding field, impying it didn't respond to such a method.

Now, the argument is explicitly cast to a symbol before checking if such
a field exists, supporting checking `respond_to?` with both argument
types.
@cgunther cgunther force-pushed the custom-field-list-respond-to-string branch from 37dec19 to 83584cc Compare March 6, 2024 19:49
@cgunther
Copy link
Contributor Author

cgunther commented Mar 6, 2024

CI is failing because of an upstream change in Nori, which can be fixed by #607

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.

1 participant