Sha256: 8f55363b4275c6f6157e5382fb231fcf629bea510a25ce9f51ada0d30b47108a

Contents?: true

Size: 362 Bytes

Versions: 9

Compression:

Stored size: 362 Bytes

Contents

class ProductProperty < ActiveRecord::Base
  belongs_to :product
  belongs_to :property
  
  validates :property, :presence => true
  
  # virtual attributes for use with AJAX completion stuff
  def property_name
    property.name if property
  end
  
  def property_name=(name)    
    self.property = Property.find_by_name(name) unless name.blank?
  end  
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
spree_core-0.30.2 app/models/product_property.rb
spree_core-0.40.4 app/models/product_property.rb
spree_core-0.40.3 app/models/product_property.rb
spree_core-0.40.2 app/models/product_property.rb
spree_core-0.40.1 app/models/product_property.rb
spree_core-0.40.0 app/models/product_property.rb
spree_core-0.30.1 app/models/product_property.rb
spree_core-0.30.0 app/models/product_property.rb
spree_core-0.30.0.beta1 app/models/product_property.rb