From aa633e47959d7479679c19491fa4ac54ee208f3b Mon Sep 17 00:00:00 2001 From: Prommah Date: Tue, 3 Nov 2015 11:46:11 +0000 Subject: [PATCH] Revert Verification.contain --- lib/verification.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/verification.rb b/lib/verification.rb index 1d6063d..5b70264 100755 --- a/lib/verification.rb +++ b/lib/verification.rb @@ -54,7 +54,11 @@ module Verification end # TODO: rikki? + # Returns true if params (or its keys) are a subset of 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