Last active
December 19, 2015 14:19
-
-
Save beatrichartz/5968572 to your computer and use it in GitHub Desktop.
Picky Bug Report
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'picky' | |
Shoe = Struct.new(:id, :color, :name) | |
shoes_index = Picky::Index.new(:shoes) do | |
category :color | |
category :name | |
end | |
shoes_search = Picky::Search.new(shoes_index) | |
shoes_index.add Shoe.new(1, 'black', 'Outdoor Black') | |
shoes_search.facets(:color) #=> {'black' => 1} | |
shoes_search.facets(:color, filter: 'black') #=> {'black' => 2} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Also: Thanks for the gist file – very helpful!