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 warning: dont call =~ on an Array, which is returning nil anyhow #94

Merged
merged 3 commits into from
Jul 20, 2022

Conversation

mathieujobin
Copy link
Collaborator

No description provided.

@mathieujobin mathieujobin merged commit 511ef91 into master Jul 20, 2022
@@ -24,7 +24,7 @@ def match_field

def parse_hash(hash)
hash.inject({}) do |parsed, (key, val)|
if session && val =~ /^#{capture_model}$/
if session && !val.is_a?(Array) && val =~ /^#{capture_model}$/

Choose a reason for hiding this comment

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

@mathieujobin I'm seeing this error also for Hash. Could this be changed to only perform the regex check if val.is_a?(String)?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@ejennings-mdsol yes it can, I simply preferred to make as little behavioral changes as possible.
If you think it's safe to do it on String only. we can update it.
I am also tempted to add the exclusion on Hash as well, so that if val is something else, we would know

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

You are correct... I made this change, will be released as v0.7.2

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.

None yet

2 participants