Adding ponies and filtering

This commit is contained in:
Will Marshall
2014-06-20 17:14:05 +10:00
parent 1eaf2c3bc5
commit 3fc337299b
2 changed files with 8 additions and 1 deletions

View File

@@ -0,0 +1,7 @@
Darkswarm.filter 'products', (Matcher)->
(products, text)->
products ||= []
text ?= ""
products.filter (product)=>
propertiesToMatch = [product.name, product.supplier.name, product.primary_taxon.name]
Matcher.match propertiesToMatch, text