Sha256: 2f6e411ff809c9493744bb3e96acfc622a0983162e40c99af6ddc4e9af176c14

Contents?: true

Size: 530 Bytes

Versions: 10

Compression:

Stored size: 530 Bytes

Contents

module Comee
  module Core
    class ProductLookup < ApplicationRecord
      belongs_to :product
      belongs_to :itemable, polymorphic: true

      validates :code, :item_description, presence: true

      validates :code, uniqueness: {scope: %i[product_id itemable_id itemable_type]}

      def self.ransackable_attributes(_auth_object = nil)
        %w[id code item_description itemable_id itemable_type product_id]
      end

      def self.ransackable_associations(_auth_object = nil)
        []
      end
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
comee_core-0.3.5 app/models/comee/core/product_lookup.rb
comee_core-0.3.4 app/models/comee/core/product_lookup.rb
comee_core-0.3.3 app/models/comee/core/product_lookup.rb
comee_core-0.3.2 app/models/comee/core/product_lookup.rb
comee_core-0.3.1 app/models/comee/core/product_lookup.rb
comee_core-0.3.0 app/models/comee/core/product_lookup.rb
comee_core-0.2.99 app/models/comee/core/product_lookup.rb
comee_core-0.2.98 app/models/comee/core/product_lookup.rb
comee_core-0.2.97 app/models/comee/core/product_lookup.rb
comee_core-0.2.96 app/models/comee/core/product_lookup.rb