Sha256: 356c0a4ef6e742c11925b48df3fe4f8699c0cf020477be1a2e2767b2148a69e0

Contents?: true

Size: 516 Bytes

Versions: 2

Compression:

Stored size: 516 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]}

      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

2 entries across 2 versions & 1 rubygems

Version Path
comee_core-0.2.95 app/models/comee/core/product_lookup.rb
comee_core-0.2.94 app/models/comee/core/product_lookup.rb