cats_core 1.0.44 → 1.0.45
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 296c1ea2692ccbfda9597044d6dd6f92a26dae42d008448d492a38b746906bc5
|
4
|
+
data.tar.gz: 37594e0dff5425a1f6e037cf427793b1ca6af54b6fe1b2a04e00b139a96b5417
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: af90696c4bfd02c65eb3b5d37a0be9a446d4a627e75c10ab2925d42038ff7113dfd2f56b8fd47403ffabeb106066e0644202f64cca49611956819eaf898989d3
|
7
|
+
data.tar.gz: '007480b8cb6ded9688d94736634593e3004e6a1dc874a9e34d05674b9580c937046922d6dffd9a1d812501d09c2a188f4929ad9f23371ac82d43664a14653c55'
|
@@ -1,11 +1,18 @@
|
|
1
1
|
module Cats
|
2
2
|
module Core
|
3
3
|
class Dispatch < ApplicationRecord
|
4
|
+
DRAFT = 'Draft'.freeze
|
5
|
+
APPROVED = 'Approved'.freeze
|
6
|
+
STARTED = 'Started'.freeze
|
7
|
+
|
8
|
+
DISPATCH_STATUSES = [DRAFT, APPROVED, STARTED].freeze
|
9
|
+
|
4
10
|
belongs_to :prepared_by, class_name: 'Cats::Core::User'
|
5
11
|
belongs_to :transporter
|
6
12
|
belongs_to :allocation_item
|
7
13
|
|
8
14
|
validates :reference_no, :plate_no, :driver_name, :driver_phone, :quantity, :commodity_status, presence: true
|
15
|
+
validates :dispatch_status, presence: true, inclusion: { in: DISPATCH_STATUSES }
|
9
16
|
validates :reference_no, uniqueness: true
|
10
17
|
validates :quantity, numericality: { greater_than: 0 }
|
11
18
|
validates :commodity_status, inclusion: { in: Cats::Core::Commodity::COMMODITY_STATUSES }
|
data/lib/cats/core/version.rb
CHANGED