mirror of
https://github.com/ENSL/ensl.org.git
synced 2024-11-15 01:11:23 +00:00
Fix Verification.contain not processing string keys
This commit is contained in:
parent
dd899cddb0
commit
080619ba54
1 changed files with 3 additions and 2 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue