Class: Spree::OptionType

Inherits:
Base
  • Object
show all
Defined in:
app/models/spree/option_type.rb

Overview

Option types denote the different options for a variant. A typical option type would be a size, with that option type’s values being something such as “Small”, “Medium” and “Large”. Another typical option type could be a color, such as “Red”, “Green”, or “Blue”.

A product can be assigned many option types, but must be assigned at least one if you wish to create variants for that product.

Instance Method Summary collapse

Methods inherited from Base

page

Methods included from Preferences::Preferable

#default_preferences, #defined_preferences, #get_preference, #has_preference!, #has_preference?, #preference_default, #preference_type, #set_preference

Instance Method Details

#touch_all_productsObject



26
27
28
# File 'app/models/spree/option_type.rb', line 26

def touch_all_products
  products.update_all(updated_at: Time.current)
end