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 +4 -4
- data/app/models/cats/core/beneficiary.rb +2 -0
- data/app/models/cats/core/beneficiary_category.rb +3 -0
- data/app/models/cats/core/beneficiary_plan_item.rb +1 -0
- data/app/models/cats/core/plan.rb +3 -0
- data/app/models/cats/core/plan_item.rb +1 -0
- data/app/models/cats/core/ration.rb +1 -0
- 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: 41699f66a4650b220cf3d02f028da8baade6d675d25f06823342d8fb11287309
|
4
|
+
data.tar.gz: a1e7903ad574573c09a87df11fc67ca133546abee2a44efd3e2d12cd0d44982f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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 }
|
@@ -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
|
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.4.
|
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-
|
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
|