Sha256: 5f68b1af0fa463c1a96076df726616cdc87af29507f99fe90f7b0a22a55f84a3
Contents?: true
Size: 485 Bytes
Versions: 89
Compression:
Stored size: 485 Bytes
Contents
module Spree class Classification < Spree::Base self.table_name = 'spree_products_taxons' acts_as_list scope: :taxon with_options inverse_of: :classifications, touch: true do belongs_to :product, class_name: 'Spree::Product' belongs_to :taxon, class_name: 'Spree::Taxon' end validates :taxon, :product, presence: true # For #3494 validates :taxon_id, uniqueness: { scope: :product_id, message: :already_linked, allow_blank: true } end end
Version data entries
89 entries across 89 versions & 1 rubygems