Skip to content

Commit

Permalink
Merge pull request #197 from zidcn/fix-ruby-deprecated-warning
Browse files Browse the repository at this point in the history
Fix Ruby 2.7 deprecated warning (when trying to regex match an Integer)
  • Loading branch information
jhund authored Jul 12, 2021
2 parents 7f5dea8 + 2488ef5 commit 3ffa945
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/filterrific/param_set.rb
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ def condition_filterrific_params(fp)
# type cast Hash to OpenStruct so that nested params render correctly
# in the form
fp[key] = OpenStruct.new(fp[key])
when val =~ integer_detector_regex
when val.is_a?(String) && val =~ integer_detector_regex
# type cast integer
fp[key] = fp[key].to_i
end
Expand Down

0 comments on commit 3ffa945

Please sign in to comment.