Class: Workarea::Search::FacetValues
- Inherits:
-
Object
- Object
- Workarea::Search::FacetValues
- Defined in:
- app/models/workarea/search/facet_values.rb
Class Method Summary collapse
-
.sanitize(values) ⇒ Array<String>
Clean up values to remove blanks, duplicates, and extra whitespace.
Class Method Details
.sanitize(values) ⇒ Array<String>
Clean up values to remove blanks, duplicates, and extra whitespace. Also converts all values to be strings. Used when adding product facet values into the Elasticsearch index.
11 12 13 |
# File 'app/models/workarea/search/facet_values.rb', line 11 def self.sanitize(values) Array(values).flatten.map(&:to_s).reject(&:blank?).map(&:strip).uniq end |