Fix parameter hash detection
Hash-like objects will respond to each_value, whereas arrays do not.
This commit is contained in:
@@ -2,7 +2,7 @@ module Searchable
|
|||||||
extend ActiveSupport::Concern
|
extend ActiveSupport::Concern
|
||||||
|
|
||||||
def parameter_hash?(params)
|
def parameter_hash?(params)
|
||||||
params.present? && params.respond_to?(:each)
|
params.present? && params.respond_to?(:each_value)
|
||||||
end
|
end
|
||||||
|
|
||||||
def parameter_depth(params)
|
def parameter_depth(params)
|
||||||
|
|||||||
Reference in New Issue
Block a user