Sha256: ceb3a0135f2332dc8fad398fe0e4fef286d4a77b0dfa17bb3d7da58e44699f6f
Contents?: true
Size: 657 Bytes
Versions: 33
Compression:
Stored size: 657 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 validates :position, numericality: { only_integer: true, allow_blank: true, allow_nil: true } # For #3494 validates :taxon_id, uniqueness: { scope: :product_id, message: :already_linked, allow_blank: true } self.whitelisted_ransackable_attributes = ['taxon_id', 'product_id'] end end
Version data entries
33 entries across 33 versions & 1 rubygems