Sha256: b07534cf6f9c176e91168459825e6d9c64230586513e531ebd21248c1e28ee47
Contents?: true
Size: 688 Bytes
Versions: 9
Compression:
Stored size: 688 Bytes
Contents
module KktShoppe class Product < ActiveRecord::Base # Product attributes for this product has_many :product_attributes, -> { order(:position) }, :class_name => 'KktShoppe::ProductAttribute' # Used for setting an array of product attributes which will be updated. Usually # received from a web browser. attr_accessor :product_attributes_array # After saving automatically try to update the product attributes based on the # the contents of the product_attributes_array array. after_save do if product_attributes_array.is_a?(Array) self.product_attributes.update_from_array(product_attributes_array) end end end end
Version data entries
9 entries across 9 versions & 1 rubygems