cats_core 1.2.5 → 1.2.9
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/models/cats/core/transport_service_offer.rb +2 -0
- data/app/models/cats/core/transport_service_request.rb +4 -1
- data/app/models/cats/core/transport_service_request_item.rb +4 -0
- data/app/models/cats/core/user.rb +4 -0
- data/db/migrate/20211209155113_create_cats_core_transport_service_requests.rb +1 -1
- data/lib/cats/core/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5663c0eaa392c4615048690c71928842718010535c337326074509dcdfeb8330
|
4
|
+
data.tar.gz: ed4d00ce0638ff2cb9db16213fef37e5a50b6633fc8aa7e2c18faabab2d0a993
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 75ee5893657e7509a0644856177ef2dcab134f53b15c126e14315ed6ebd150bfb9ddff553d0fc35b6cafbad9d2e79df0387f099428a8226e973bd184f3591b3a
|
7
|
+
data.tar.gz: ae1a10d375b6c38dd0aeb9221ed46eaa0065a8295c35ef5a3ac17ec6251bb61ed873a4e67541494a6911b2623f5e82e3b455f7f7b114f65cae9fc636ef6e8e2e
|
@@ -6,11 +6,14 @@ module Cats
|
|
6
6
|
STATUSES = [DRAFT, APPROVED].freeze
|
7
7
|
|
8
8
|
belongs_to :requested_by, class_name: 'Cats::Core::User'
|
9
|
-
belongs_to :approved_by, class_name: 'Cats::Core::User'
|
9
|
+
belongs_to :approved_by, class_name: 'Cats::Core::User', optional: true
|
10
10
|
|
11
11
|
validates :reference_no, :request_date, :status, presence: true
|
12
12
|
validates :reference_no, uniqueness: true
|
13
13
|
validates :status, inclusion: { in: STATUSES }
|
14
|
+
|
15
|
+
delegate(:full_name, to: :requested_by, prefix: true, allow_nil: true)
|
16
|
+
delegate(:full_name, to: :approved_by, prefix: true, allow_nil: true)
|
14
17
|
end
|
15
18
|
end
|
16
19
|
end
|
@@ -5,6 +5,10 @@ module Cats
|
|
5
5
|
belongs_to :source, class_name: 'Cats::Core::Location'
|
6
6
|
belongs_to :destination, class_name: 'Cats::Core::Location'
|
7
7
|
belongs_to :commodity
|
8
|
+
|
9
|
+
delegate(:name, to: :source, prefix: true)
|
10
|
+
delegate(:name, to: :destination, prefix: true)
|
11
|
+
delegate(:name, to: :commodity, prefix: true)
|
8
12
|
end
|
9
13
|
end
|
10
14
|
end
|
@@ -9,7 +9,7 @@ class CreateCatsCoreTransportServiceRequests < ActiveRecord::Migration[6.1]
|
|
9
9
|
index: { name: 'tsr_on_rb_indx' },
|
10
10
|
foreign_key: { to_table: :cats_core_users }
|
11
11
|
t.references :approved_by,
|
12
|
-
null:
|
12
|
+
null: true,
|
13
13
|
index: { name: 'tsr_on_ab_indx' },
|
14
14
|
foreign_key: { to_table: :cats_core_users }
|
15
15
|
|
data/lib/cats/core/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cats_core
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.2.
|
4
|
+
version: 1.2.9
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Henock L.
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-12-
|
11
|
+
date: 2021-12-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: active_model_serializers
|