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: bda6e203d5cc23b15dfdb7cf523a175b4a620b5bfb4e630e89c088bf220162f3
4
- data.tar.gz: 2522727f3c712519f63681267b53405ce2b89a7dcdc599d1bc86810ce16b2bf5
3
+ metadata.gz: 13bc9433b974cded9d6145d8bffc52e7669f3688b70ee861e5ad2c74110c3d2c
4
+ data.tar.gz: b8cdd5dae74d00d59ae9a75bf63aed63a8873dbd3a578b14c953ea2c52235a3a
5
5
  SHA512:
6
- metadata.gz: eede7fe1153179c4f3349c0124cccfe6c97e49941ff0ab9a4465239bb5afd05ea40c6e6d156b2693c288d6a9de7ebbe049b05e98474f5d91c630808820fe74d7
7
- data.tar.gz: 5c673873887a2cd373fc6c7fc586bd46477b9f377dfcab4b9328fc91cfb0ee515ac8c58ec3afd5139a7f99422019d68dbea709f24e6da8dfa312f2aecf23a33f
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, :unit_of_measure, presence: true, if: -> { donation_type == KIND }
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
@@ -1,5 +1,5 @@
1
1
  module Cats
2
2
  module Core
3
- VERSION = '1.0.43'.freeze
3
+ VERSION = '1.0.44'.freeze
4
4
  end
5
5
  end
@@ -3,7 +3,6 @@ FactoryBot.define do
3
3
  reference_no { FFaker::Name.name }
4
4
  gift_date { Date.today - 1.month }
5
5
  donation
6
- commodity_category
7
6
  vessel { FFaker::Name.name }
8
7
  port { FFaker::Name.name }
9
8
  customs_declaration_no { FFaker::Name.name }
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cats_core
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.43
4
+ version: 1.0.44
5
5
  platform: ruby
6
6
  authors:
7
7
  - Henock L.