cats_core 1.0.43 → 1.0.44
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: 13bc9433b974cded9d6145d8bffc52e7669f3688b70ee861e5ad2c74110c3d2c
|
4
|
+
data.tar.gz: b8cdd5dae74d00d59ae9a75bf63aed63a8873dbd3a578b14c953ea2c52235a3a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2ae137b536163fbf766211a80ef278eebd5b4ab45023076b9c429594dd08cc5a976ad07bf3a063b11a3d601968112cd274385a54f1578cc10f9126589bfdb7a4
|
7
|
+
data.tar.gz: 1433945abdd51c8a3f367920cb7ebe63d291d71448f7d617324352c9bc958a16abfe3ae888f4237e42274db0dcc9f59e4fb4a626ebc13e0a6dc8a09373f9058f
|
@@ -15,10 +15,14 @@ module Cats
|
|
15
15
|
validates :reference_no, uniqueness: true
|
16
16
|
validates :donation_type, inclusion: { in: DONATION_TYPES }
|
17
17
|
validates :currency, presence: true, if: -> { donation_type == CASH }
|
18
|
-
validates :commodity_category,
|
18
|
+
validates :commodity_category, presence: true, if: -> { donation_type == KIND }
|
19
|
+
validates :unit_of_measure, presence: true, if: -> { donation_type == KIND }
|
19
20
|
|
20
21
|
delegate(:name, to: :donor, prefix: true)
|
21
22
|
delegate(:reference_no, to: :hrp, prefix: true)
|
23
|
+
delegate(:name, to: :commodity_category, prefix: true, allow_nil: true)
|
24
|
+
delegate(:code, to: :currency, prefix: true, allow_nil: true)
|
25
|
+
delegate(:abbreviation, to: :unit_of_measure, prefix: true, allow_nil: true)
|
22
26
|
end
|
23
27
|
end
|
24
28
|
end
|
@@ -2,12 +2,9 @@ module Cats
|
|
2
2
|
module Core
|
3
3
|
class GiftCertificate < ApplicationRecord
|
4
4
|
belongs_to :donation
|
5
|
-
belongs_to :commodity_category
|
6
5
|
|
7
6
|
validates :reference_no, presence: true, uniqueness: true
|
8
7
|
validates :gift_date, presence: true
|
9
|
-
|
10
|
-
delegate(:name, to: :commodity_category, prefix: true)
|
11
8
|
end
|
12
9
|
end
|
13
10
|
end
|
@@ -8,10 +8,6 @@ class CreateCatsCoreGiftCertificates < ActiveRecord::Migration[6.1]
|
|
8
8
|
null: false,
|
9
9
|
index: { name: 'gc_on_donation_indx' },
|
10
10
|
foreign_key: { to_table: :cats_core_donations }
|
11
|
-
t.references :commodity_category,
|
12
|
-
null: false,
|
13
|
-
index: { name: 'gc_on_cc_indx' },
|
14
|
-
foreign_key: { to_table: :cats_core_commodity_categories }
|
15
11
|
|
16
12
|
t.string :vessel
|
17
13
|
t.string :port
|
data/lib/cats/core/version.rb
CHANGED