Added item_property to where filter
This commit is contained in:
parent
edfa1c8ecd
commit
a5c1a01965
|
@ -185,9 +185,9 @@ module Jekyll
|
||||||
# value - desired value
|
# value - desired value
|
||||||
#
|
#
|
||||||
# Returns the filtered array of objects
|
# Returns the filtered array of objects
|
||||||
def where(input, key, value)
|
def where(input, property, value)
|
||||||
return input unless input.is_a?(Array)
|
return input unless input.is_a?(Array)
|
||||||
input.select { |object| object[key] == value }
|
input.select { |object| item_property(object, property) == value }
|
||||||
end
|
end
|
||||||
|
|
||||||
# Sort an array of objects
|
# Sort an array of objects
|
||||||
|
|
Loading…
Reference in New Issue