Sha256: 642238bf77fae09cfc2791306c4a69d873b09aa70207b3226949727a448fc02a

Contents?: true

Size: 485 Bytes

Versions: 43

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

43 entries across 43 versions & 1 rubygems

Version Path
spree_core-3.2.9 app/models/spree/classification.rb
spree_core-3.1.14 app/models/spree/classification.rb
spree_core-3.3.6 app/models/spree/classification.rb
spree_core-3.2.8 app/models/spree/classification.rb
spree_core-3.1.13 app/models/spree/classification.rb
spree_core-3.3.5 app/models/spree/classification.rb
spree_core-3.3.4 app/models/spree/classification.rb
spree_core-3.2.7 app/models/spree/classification.rb
spree_core-3.1.12 app/models/spree/classification.rb
spree_core-3.3.3 app/models/spree/classification.rb
spree_core-3.2.6 app/models/spree/classification.rb
spree_core-3.1.11 app/models/spree/classification.rb
spree_core-3.1.10 app/models/spree/classification.rb
spree_core-3.3.2 app/models/spree/classification.rb
spree_core-3.2.5 app/models/spree/classification.rb
spree_core-3.1.9 app/models/spree/classification.rb
spree_core-3.3.1 app/models/spree/classification.rb
spree_core-3.2.4 app/models/spree/classification.rb
spree_core-3.1.8 app/models/spree/classification.rb
spree_core-3.3.0 app/models/spree/classification.rb