From 1db62cca9e13f9ae917dab5c7c33e35fba7622f6 Mon Sep 17 00:00:00 2001 From: Mike Kruk Date: Tue, 7 Oct 2014 23:05:23 -0400 Subject: [PATCH] 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. --- lib/jekyll/filters.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/jekyll/filters.rb b/lib/jekyll/filters.rb index d6f0fa03..7d5ba982 100644 --- a/lib/jekyll/filters.rb +++ b/lib/jekyll/filters.rb @@ -219,7 +219,7 @@ module Jekyll # # Returns the filtered array of objects 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 } end