Sha256: 41fcf3a7a4d354ab37b2168d84fd584057bed97dfc202637eb10222145c8950f

Contents?: true

Size: 439 Bytes

Versions: 10

Compression:

Stored size: 439 Bytes

Contents

module Spree
  class ProductProperty < ActiveRecord::Base
    belongs_to :product
    belongs_to :property

    validates :property, :presence => true
    validates_length_of :value, :maximum => 255

    # 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
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
spree_core-1.0.4 app/models/spree/product_property.rb
spree_core-1.1.0.rc1 app/models/spree/product_property.rb
spree_core-1.0.3 app/models/spree/product_property.rb
spree_core-1.0.2 app/models/spree/product_property.rb
spree_core-1.0.1 app/models/spree/product_property.rb
spree_core-1.0.0 app/models/spree/product_property.rb
spree_core-1.0.0.rc4 app/models/spree/product_property.rb
spree_core-1.0.0.rc3 app/models/spree/product_property.rb
spree_core-1.0.0.rc2 app/models/spree/product_property.rb
spree_core-1.0.0.rc1 app/models/spree/product_property.rb