Sha256: c95d5fe630ed6d17ab1c772c65da678a45a6265139683a5263332cc2f4e61f2a
Contents?: true
Size: 628 Bytes
Versions: 12
Compression:
Stored size: 628 Bytes
Contents
module Spree class ProductProperty < ActiveRecord::Base belongs_to :product belongs_to :property validates :property, :presence => true validates :value, :length => { :maximum => 255 } attr_accessible :property_name, :value # virtual attributes for use with AJAX completion stuff def property_name property.name if property end def property_name=(name) unless name.blank? unless property = Property.find_by_name(name) property = Property.create(:name => name, :presentation => name) end self.property = property end end end end
Version data entries
12 entries across 12 versions & 2 rubygems