allow Enumerables to be used with "where" filter
Enumerable module responds to `select` so this shouldn't be a problem here. Typical use case would be an object from a plugin being passed through a where filter.
This commit is contained in:
parent
cae5958362
commit
1db62cca9e
|
@ -219,7 +219,7 @@ module Jekyll
|
||||||
#
|
#
|
||||||
# Returns the filtered array of objects
|
# Returns the filtered array of objects
|
||||||
def where(input, property, value)
|
def where(input, property, value)
|
||||||
return input unless input.is_a?(Array)
|
return input unless input.is_a?(Enumerable)
|
||||||
input.select { |object| item_property(object, property) == value }
|
input.select { |object| item_property(object, property) == value }
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue