Module: Spree::CustomFieldDefinition::SearchCapabilities

Extended by:
ActiveSupport::Concern
Included in:
Spree::CustomFieldDefinition
Defined in:
app/models/spree/custom_field_definition/search_capabilities.rb

Instance Method Summary collapse

Instance Method Details

#filter_key ⇒ String

Public identifier for sorting and filtering product listings by this custom field (+sort=cf_specs_material+, q[cf_specs_material_i_cont]=wool). Persisted, so it can be selected, indexed and ordered on; the computed form answers for a record whose callback has not run yet.

Returns:

  • (String) —

    e.g. cf_custom_label



56
57
58
# File 'app/models/spree/custom_field_definition/search_capabilities.rb', line 56

def filter_key
  self[:filter_key].presence || computed_filter_key
end