Sha256: ca472ff0770af64b35ada5da396dd2a2c7d7b5d0ef909f1c7affa911e3c995ee

Contents?: true

Size: 693 Bytes

Versions: 166

Compression:

Stored size: 693 Bytes

Contents

module Comee
  module Core
    class QuotationRequestItem < ApplicationRecord
      enum :margin_type, {increase: 0, discount: 1}
      belongs_to :product
      belongs_to :quotation_request
      belongs_to :unit

      validates :margin_type, :expected_delivery_date, presence: true
      validates :quantity, :price, presence: true, numericality: {greater_than_or_equal_to: 0}
      validates :margin, presence: true, numericality: {greater_than_or_equal_to: 0, less_than_or_equal_to: 100}

      def self.ransackable_attributes(_auth_object = nil)
        %w[id quotation_request_id product_id unit_id quantity price margin margin_type expected_delivery_date]
      end
    end
  end
end

Version data entries

166 entries across 166 versions & 1 rubygems

Version Path
comee_core-0.3.62 app/models/comee/core/quotation_request_item.rb
comee_core-0.3.61 app/models/comee/core/quotation_request_item.rb
comee_core-0.3.60 app/models/comee/core/quotation_request_item.rb
comee_core-0.3.59 app/models/comee/core/quotation_request_item.rb
comee_core-0.3.58 app/models/comee/core/quotation_request_item.rb
comee_core-0.3.57 app/models/comee/core/quotation_request_item.rb
comee_core-0.3.56 app/models/comee/core/quotation_request_item.rb
comee_core-0.3.55 app/models/comee/core/quotation_request_item.rb
comee_core-0.3.54 app/models/comee/core/quotation_request_item.rb
comee_core-0.3.53 app/models/comee/core/quotation_request_item.rb
comee_core-0.3.51 app/models/comee/core/quotation_request_item.rb
comee_core-0.3.50 app/models/comee/core/quotation_request_item.rb
comee_core-0.3.49 app/models/comee/core/quotation_request_item.rb
comee_core-0.3.48 app/models/comee/core/quotation_request_item.rb
comee_core-0.3.47 app/models/comee/core/quotation_request_item.rb
comee_core-0.3.46 app/models/comee/core/quotation_request_item.rb
comee_core-0.3.45 app/models/comee/core/quotation_request_item.rb
comee_core-0.3.44 app/models/comee/core/quotation_request_item.rb
comee_core-0.3.43 app/models/comee/core/quotation_request_item.rb
comee_core-0.3.42 app/models/comee/core/quotation_request_item.rb