Commit 563b1d33 by Willian Fernandes Committed by ifool

Use Enumerable#include? instead of Hash#member?

Rails 5 is changing  and it no longer inherits from hash
parent 0d514aaa
...@@ -15,7 +15,7 @@ module RailsParam ...@@ -15,7 +15,7 @@ module RailsParam
def param!(name, type, options = {}, &block) def param!(name, type, options = {}, &block)
name = name.to_s unless name.is_a? Integer # keep index for validating elements name = name.to_s unless name.is_a? Integer # keep index for validating elements
return unless params.member?(name) || check_param_presence?(options[:default]) || options[:required] return unless params.include?(name) || check_param_presence?(options[:default]) || options[:required]
begin begin
params[name] = coerce(params[name], type, options) params[name] = coerce(params[name], type, options)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment