Sha256: 1ee5079425002cb51bcd55daf6935c152d6f83d2973f1157025d448652ecdf82
Contents?: true
Size: 687 Bytes
Versions: 14
Compression:
Stored size: 687 Bytes
Contents
module Spree class OptionValue < ActiveRecord::Base belongs_to :option_type, class_name: 'Spree::OptionType', touch: true, inverse_of: :option_values acts_as_list scope: :option_type has_and_belongs_to_many :variants, join_table: 'spree_option_values_variants', class_name: "Spree::Variant" validates :name, :presentation, presence: true after_touch :touch_all_variants def touch_all_variants # This can cause a cascade of products to be updated # To disable it in Rails 4.1, we can do this: # https://github.com/rails/rails/pull/12772 # Spree::Product.no_touching do variants.find_each(&:touch) # end end end end
Version data entries
14 entries across 14 versions & 1 rubygems