Module: ProductGroupSearch::CoreFieldStrategy

Defined in:
lib/nimbleshop/product_group_search/core_field_strategy.rb

Instance Method Summary collapse

Instance Method Details

#field_typeObject



18
19
20
21
22
23
24
25
# File 'lib/nimbleshop/product_group_search/core_field_strategy.rb', line 18

def field_type
  # TODO megpha why special treatment to :price field
  if query_column == :price
    'number'
  else
    'text'
  end
end

#join(proxy) ⇒ Object



3
4
5
# File 'lib/nimbleshop/product_group_search/core_field_strategy.rb', line 3

def join(proxy)
  proxy
end

#localized_nameObject



27
28
29
# File 'lib/nimbleshop/product_group_search/core_field_strategy.rb', line 27

def localized_name
  self.name
end

#query_columnObject



14
15
16
# File 'lib/nimbleshop/product_group_search/core_field_strategy.rb', line 14

def query_column
  self.name.try(:to_sym)
end

#target_tableObject



7
8
9
10
11
12
# File 'lib/nimbleshop/product_group_search/core_field_strategy.rb', line 7

def target_table
  unless @_target
    @_target = Product.arel_table
  end
  @_target
end