Module: Workarea::Search::Storefront::Product::Facets
- Extended by:
- ActiveSupport::Concern
- Included in:
- Workarea::Search::Storefront::Product
- Defined in:
- app/models/workarea/search/storefront/product/facets.rb
Defined Under Namespace
Modules: ClassMethods
Instance Method Summary collapse
-
#facets ⇒ Hash
Fields for faceting, as defined by the contents of the filters hash on the Catalog::Product.
Instance Method Details
#facets ⇒ Hash
Fields for faceting, as defined by the contents of the filters hash on the Catalog::Product.
38 39 40 41 42 43 44 45 46 47 48 |
# File 'app/models/workarea/search/storefront/product/facets.rb', line 38 def facets result = model.filters.reduce({}) do |memo, tuple| key, value = *tuple memo[key.to_s.systemize] = FacetValues.sanitize(value) memo end result[:category] = if .present? result[:category_id] = category_id result end |