mirror of
https://github.com/ENSL/ensl.org.git
synced 2024-12-27 21:10:54 +00:00
Revert Verification.contain
This commit is contained in:
parent
2c76afe481
commit
aa633e4795
1 changed files with 5 additions and 1 deletions
|
@ -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
|
||||||
|
|
Loading…
Reference in a new issue