cats_core 1.4.14 → 1.4.17

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: ca208d0dcbfa973b2bdd945ecde86050c69d568a98c3f7193cf501588724a071
4
- data.tar.gz: a0a2bf98a2d76367851efa05d7dd1d4b3ae476a8c7f9877ebb8eb1be6e92c731
3
+ metadata.gz: 41699f66a4650b220cf3d02f028da8baade6d675d25f06823342d8fb11287309
4
+ data.tar.gz: a1e7903ad574573c09a87df11fc67ca133546abee2a44efd3e2d12cd0d44982f
5
5
  SHA512:
6
- metadata.gz: 2d28cd3608303b9cef467e1a79092e62d89e04e6f15b3e95923f68423849998ef989cc8bde0eb50f4f3b4b6949e3de1061bd970235fb465a3347699b1552c47a
7
- data.tar.gz: 5a3d79875dd6045407150cafd34c1dbf51f5cbbed8488b6298680b26d95aec908be88737b95dede16a77c8306031058462438ce437c74e7422320a40f752d69d
6
+ metadata.gz: a32b2685361ee616976123043970cf782d6180ac5b5d1d885ed3bf78dc4a36774ae004fc5640dd0fa50223f522c5c009a7be3ffb988c3edd05f7e454119e950b
7
+ data.tar.gz: 4cf9dcd0928eeaec7bceb628cb21486263b07f426cb9846ae587c8112eec488e938a1735ebac5d7338a5a65cea507d15223a9a7eb2499575348106b893dc3acc
@@ -10,6 +10,8 @@ module Cats
10
10
  validates :full_name, :age, :gender, presence: true
11
11
  validates :gender, inclusion: { in: GENDERS }
12
12
  validates :age, numericality: { greater_than: 0, less_than: 100 }
13
+
14
+ delegate(:name, to: :beneficiary_category, prefix: true)
13
15
  end
14
16
  end
15
17
  end
@@ -2,9 +2,12 @@ module Cats
2
2
  module Core
3
3
  class BeneficiaryCategory < ApplicationRecord
4
4
  belongs_to :plan
5
+ has_many :rations
5
6
 
6
7
  validates :code, :name, presence: true
7
8
  validates :code, uniqueness: true
9
+
10
+ delegate(:reference_no, to: :plan, prefix: true)
8
11
  end
9
12
  end
10
13
  end
@@ -3,6 +3,7 @@ module Cats
3
3
  class BeneficiaryPlanItem < ApplicationRecord
4
4
  belongs_to :plan_item
5
5
  belongs_to :beneficiary_category
6
+ has_many :plan_item_details
6
7
 
7
8
  validates :beneficiaries, presence: true, numericality: { greater_than: 0 }
8
9
  validates :plan_item_id, uniqueness: { scope: :beneficiary_category_id }
@@ -13,9 +13,12 @@ module Cats
13
13
  SEASONS = [BELG, MEHER, ANNUAL].freeze
14
14
 
15
15
  belongs_to :program
16
+ has_many :beneficiary_categories
17
+ has_many :rations, through: :beneficiary_categories
16
18
  has_many :plan_items
17
19
  has_many :round_plans
18
20
  has_many :beneficiary_plan_items, through: :plan_items
21
+ has_many :plan_item_details, through: :beneficiary_plan_items
19
22
 
20
23
  validates :reference_no, :year, :status, presence: true
21
24
  validates :total_days, :rounds, presence: true, numericality: { greater_than: 0 }
@@ -10,6 +10,7 @@ module Cats
10
10
  belongs_to :operator
11
11
 
12
12
  has_many :beneficiary_plan_items
13
+ has_many :plan_item_details, through: :beneficiary_plan_items
13
14
 
14
15
  validates :plan_id, uniqueness: { scope: :fdp_id }
15
16
 
@@ -9,6 +9,7 @@ module Cats
9
9
  validates :quantity, :no_of_days, presence: true, numericality: { greater_than: 0 }
10
10
 
11
11
  delegate(:name, to: :commodity_category, prefix: true)
12
+ delegate(:name, to: :beneficiary_category, prefix: true)
12
13
  delegate(:abbreviation, to: :unit_of_measure, prefix: true)
13
14
  end
14
15
  end
@@ -1,5 +1,5 @@
1
1
  module Cats
2
2
  module Core
3
- VERSION = '1.4.14'.freeze
3
+ VERSION = '1.4.17'.freeze
4
4
  end
5
5
  end
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.4.14
4
+ version: 1.4.17
5
5
  platform: ruby
6
6
  authors:
7
7
  - Henock L.
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-05-15 00:00:00.000000000 Z
11
+ date: 2022-05-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: active_model_serializers