Sha256: a8eea6c54244e4b0deefcf112fe3cf65dd14702e49625a94eb93dc520f9017ee

Contents?: true

Size: 648 Bytes

Versions: 55

Compression:

Stored size: 648 Bytes

Contents

module Comee
  module Core
    class ShipmentItem < ApplicationRecord
      enum :status, {active: 0, completed: 1}

      belongs_to :sales_order_item
      has_many :item_statuses

      validates :handover_date, :delivery_date, :shipment_status, :status, :order_number, presence: true
      validates :quantity, presence: true, numericality: {greater_than: 0}

      def self.ransackable_attributes(_auth_object = nil)
        %w[id delivery_date handover_date pallet_no quantity sales_order_item_id shipment_status]
      end

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

Version data entries

55 entries across 55 versions & 1 rubygems

Version Path
comee_core-0.2.55 app/models/comee/core/shipment_item.rb
comee_core-0.2.54 app/models/comee/core/shipment_item.rb
comee_core-0.2.53 app/models/comee/core/shipment_item.rb
comee_core-0.2.52 app/models/comee/core/shipment_item.rb
comee_core-0.2.51 app/models/comee/core/shipment_item.rb
comee_core-0.2.50 app/models/comee/core/shipment_item.rb
comee_core-0.2.49 app/models/comee/core/shipment_item.rb
comee_core-0.2.48 app/models/comee/core/shipment_item.rb
comee_core-0.2.47 app/models/comee/core/shipment_item.rb
comee_core-0.2.46 app/models/comee/core/shipment_item.rb
comee_core-0.2.45 app/models/comee/core/shipment_item.rb
comee_core-0.2.44 app/models/comee/core/shipment_item.rb
comee_core-0.2.43 app/models/comee/core/shipment_item.rb
comee_core-0.2.42 app/models/comee/core/shipment_item.rb
comee_core-0.2.41 app/models/comee/core/shipment_item.rb
comee_core-0.2.40 app/models/comee/core/shipment_item.rb
comee_core-0.2.39 app/models/comee/core/shipment_item.rb
comee_core-0.2.38 app/models/comee/core/shipment_item.rb
comee_core-0.2.37 app/models/comee/core/shipment_item.rb
comee_core-0.2.36 app/models/comee/core/shipment_item.rb