Sha256: 291f8912266af49a5f392e350e8288ea7614af376f57b83472b1bbc94576ec09

Contents?: true

Size: 831 Bytes

Versions: 13

Compression:

Stored size: 831 Bytes

Contents

module Comee
  module Core
    class ItemStatus < ApplicationRecord
      INITIALIZED = "Initialized".freeze
      DELIVERY_NOTE_CREATED = "Delivery note created".freeze
      COMPLETELY_PICKED_AND_PACKED = "Completely Picked & Packed".freeze
      PARTIALLY_PICKED_AND_PACKED = "Partially Picked & Packed".freeze

      STATUSES = [INITIALIZED, DELIVERY_NOTE_CREATED, COMPLETELY_PICKED_AND_PACKED, PARTIALLY_PICKED_AND_PACKED].freeze

      belongs_to :shipment_item

      validates :hash_code, :status, :status_date, presence: true
      validates :status, inclusion: {in: STATUSES}

      def self.ransackable_attributes(_auth_object = nil)
        %w[hash_code status status_date sales_order_item_id]
      end

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

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
comee_core-0.1.90 app/models/comee/core/item_status.rb
comee_core-0.1.89 app/models/comee/core/item_status.rb
comee_core-0.1.88 app/models/comee/core/item_status.rb
comee_core-0.1.87 app/models/comee/core/item_status.rb
comee_core-0.1.86 app/models/comee/core/item_status.rb
comee_core-0.1.85 app/models/comee/core/item_status.rb
comee_core-0.1.84 app/models/comee/core/item_status.rb
comee_core-0.1.83 app/models/comee/core/item_status.rb
comee_core-0.1.82 app/models/comee/core/item_status.rb
comee_core-0.1.81 app/models/comee/core/item_status.rb
comee_core-0.1.80 app/models/comee/core/item_status.rb
comee_core-0.1.79 app/models/comee/core/item_status.rb
comee_core-0.1.78 app/models/comee/core/item_status.rb