Class: Cats::Core::TransportOrderItem

Inherits:
ApplicationRecord show all
Defined in:
app/models/cats/core/transport_order_item.rb

Constant Summary collapse

ACTIVE =
"Active".freeze
CANCELLED =
"Cancelled".freeze
EXPIRED =
"Expired".freeze
ORDER_ITEM_STATUSES =
[ACTIVE, CANCELLED, EXPIRED].freeze

Instance Method Summary collapse

Instance Method Details

#validate_requisitionObject



33
34
35
36
37
38
39
40
41
# File 'app/models/cats/core/transport_order_item.rb', line 33

def validate_requisition
  return unless transport_requisition_item

  return unless transport_order

  return if transport_order.transport_requisition_id == transport_requisition_item.transport_requisition_id

  errors.add(:transport_requisition_item, "does not belong to the requisition of the order.")
end