Revert Verification.contain

This commit is contained in:
Prommah 2015-11-03 11:46:11 +00:00
parent a460020a3e
commit 0b347baee7

View file

@ -54,7 +54,11 @@ module Verification
end end
# TODO: rikki? # TODO: rikki?
# Returns true if params (or its keys) are a subset of filter
def self.contain(params, filter) def self.contain(params, filter)
params.instance_of?(Array) ? (filter - params).empty? : filter.all? { |s| params.key? s } (params.instance_of?(Array) ? params : params.keys).each do |key|
return false unless filter.include? key.to_sym
end
true
end end
end end