Class: Spree::ProductProperty

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

Instance Method Summary collapse

Methods inherited from Base

page, spree_base_scopes

Methods included from Spree::Preferences::Preferable

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

Instance Method Details

#property_name=(name) ⇒ Object



22
23
24
25
26
27
# File 'app/models/spree/product_property.rb', line 22

def property_name=(name)
  if name.present?
    # don't use `find_by :name` to workaround globalize/globalize#423 bug
    self.property = Property.where(name: name).first_or_create(presentation: name)
  end
end