cats_core 1.2.4 → 1.2.5
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: 57bd0cce4510afb100e277538b46b5d090b3a5a9c48cacd4da24d9865a3a3cdd
|
4
|
+
data.tar.gz: 93e64f75bf5fb2a953d4f1dbc01667746ed5454b67857a27f27c5a3bed6bc86a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 97092e8a99a11f22d5ad044ce913f75b5a5dc39ceb55c733ef248994a5e0686b32b6af564838127510296d8b1b3cb3bd0cae0f7f743dd3b262b9c78aa9efa2fa
|
7
|
+
data.tar.gz: abcfc0f293575c891c961da89f8a038a7d83cffbe7c0c0eebb8e1cb996bc855c38f359b868db4eefaacf630f58456ae4beeb1a75d1f4e4cb80e57ab436dbc0d3
|
@@ -1,8 +1,16 @@
|
|
1
1
|
module Cats
|
2
2
|
module Core
|
3
3
|
class TransportServiceRequest < ApplicationRecord
|
4
|
-
|
4
|
+
DRAFT = 'Draft'.freeze
|
5
|
+
APPROVED = 'Approved'.freeze
|
6
|
+
STATUSES = [DRAFT, APPROVED].freeze
|
7
|
+
|
8
|
+
belongs_to :requested_by, class_name: 'Cats::Core::User'
|
9
|
+
belongs_to :approved_by, class_name: 'Cats::Core::User'
|
10
|
+
|
11
|
+
validates :reference_no, :request_date, :status, presence: true
|
5
12
|
validates :reference_no, uniqueness: true
|
13
|
+
validates :status, inclusion: { in: STATUSES }
|
6
14
|
end
|
7
15
|
end
|
8
16
|
end
|
@@ -3,6 +3,15 @@ class CreateCatsCoreTransportServiceRequests < ActiveRecord::Migration[6.1]
|
|
3
3
|
create_table :cats_core_transport_service_requests do |t|
|
4
4
|
t.string :reference_no, unique: true
|
5
5
|
t.date :request_date, null: false
|
6
|
+
t.string :status, null: false, default: 'Draft'
|
7
|
+
t.references :requested_by,
|
8
|
+
null: false,
|
9
|
+
index: { name: 'tsr_on_rb_indx' },
|
10
|
+
foreign_key: { to_table: :cats_core_users }
|
11
|
+
t.references :approved_by,
|
12
|
+
null: false,
|
13
|
+
index: { name: 'tsr_on_ab_indx' },
|
14
|
+
foreign_key: { to_table: :cats_core_users }
|
6
15
|
|
7
16
|
t.timestamps
|
8
17
|
end
|
data/lib/cats/core/version.rb
CHANGED