Fix Verification.contain not processing string keys

This commit is contained in:
Prommah 2015-11-08 07:27:49 +00:00
parent 9805d3a66e
commit 7c1865d8c1

View file

@ -54,8 +54,9 @@ module Verification
end
# TODO: rikki?
# Returns true if params (or its keys) are a subset of filter
# Returns true if params (or its keys if a hash) are a subset of filter
def self.contain(params, filter)
((params.instance_of?(Array) ? params : params.keys) - filter).empty?
keys = (params.instance_of?(Array) ? params : params.keys).map { |k| k.to_sym }
(keys - filter).empty?
end
end