From 7c1865d8c141832a168c48022c1a9c50790e37ad Mon Sep 17 00:00:00 2001 From: Prommah Date: Sun, 8 Nov 2015 07:27:49 +0000 Subject: [PATCH] Fix Verification.contain not processing string keys --- lib/verification.rb | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/verification.rb b/lib/verification.rb index ebab58c..4b86ec6 100755 --- a/lib/verification.rb +++ b/lib/verification.rb @@ -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