Class: Workarea::Catalog::DetailsQueries

Inherits:
Object
  • Object
show all
Defined in:
app/models/workarea/catalog/details_queries.rb

Class Method Summary collapse

Class Method Details

.find_details(name, query) ⇒ Array<String>

Find distinct detail values for the given field name that match the given search string.

Parameters:

Returns:



11
12
13
# File 'app/models/workarea/catalog/details_queries.rb', line 11

def self.find_details(name, query)
  find_distinct("details.#{I18n.locale}.#{name}", query)
end

.find_filters(name, query) ⇒ Array<String>

Find distinct filter values for the given field name that match the given search string.

Parameters:

Returns:



22
23
24
# File 'app/models/workarea/catalog/details_queries.rb', line 22

def self.find_filters(name, query)
  find_distinct("filters.#{I18n.locale}.#{name}", query)
end

.find_image_options(query) ⇒ Array<String>

Find distinct image option values that match the given search string.

Parameters:

Returns:



44
45
46
# File 'app/models/workarea/catalog/details_queries.rb', line 44

def self.find_image_options(query)
  find_distinct('images.option', query)
end

.find_sku_details(name, query) ⇒ Array<String>

Find distinct variant detail values for the given field name that match the given search string.

Parameters:

Returns:



33
34
35
# File 'app/models/workarea/catalog/details_queries.rb', line 33

def self.find_sku_details(name, query)
  find_distinct("variants.details.#{I18n.locale}.#{name}", query)
end