Class: Spree::ProductProperty
- Defined in:
- app/models/spree/product_property.rb
Instance Method Summary collapse
-
#property_name ⇒ Object
virtual attributes for use with AJAX completion stuff.
- #property_name=(name) ⇒ Object
Methods inherited from Base
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 ⇒ Object
virtual attributes for use with AJAX completion stuff
17 18 19 |
# File 'app/models/spree/product_property.rb', line 17 def property_name property.name if property end |
#property_name=(name) ⇒ Object
21 22 23 24 25 26 27 28 |
# File 'app/models/spree/product_property.rb', line 21 def property_name=(name) if name.present? # don't use `find_by :name` to workaround globalize/globalize#423 bug property = Property.where(name: name).first || Property.create(name: name, presentation: name) self.property = property end end |