cats_core 1.0.38 → 1.0.42
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/controllers/cats/core/locations_controller.rb +1 -1
- data/app/models/cats/core/hrp.rb +2 -1
- data/app/models/cats/core/hrp_item.rb +2 -0
- data/app/models/cats/core/hrp_item_detail.rb +0 -1
- data/app/models/cats/core/location.rb +2 -1
- data/db/migrate/20210716183620_create_cats_core_locations.rb +1 -0
- data/db/migrate/20210717031810_create_cats_core_hrps.rb +5 -1
- data/db/migrate/20210717032240_create_cats_core_hrp_item_details.rb +0 -4
- data/lib/cats/core/version.rb +1 -1
- data/spec/factories/cats/core/hrp_item_details.rb +0 -1
- data/spec/factories/cats/core/hrps.rb +1 -0
- data/spec/factories/cats/core/locations.rb +1 -0
- metadata +1 -4
- data/app/models/cats/core/hrp_ration.rb +0 -10
- data/db/migrate/20210717032106_create_cats_core_hrp_rations.rb +0 -17
- data/spec/factories/cats/core/hrp_rations.rb +0 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 459a3f07d1fadf11fb8120f91ecf18b2df1b7719e05a2e8398e0af664af1b19b
|
4
|
+
data.tar.gz: 92645ac2384a08e79db744e98e8179bcea78112c538c1b6444bbc0a6fa26d34e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 265613d922d768384446ca0e38e3dfcae4ae2bb9f07a7f8a278ebbc3f2ec87fd8c96f08ae08a5ecc605ee9903701bf8d90f45ba5583524717b65f97ad3264509
|
7
|
+
data.tar.gz: 3a8236f40c2f028c8a7cff2abcf2d08c02eb598f577e71bedf8723841301c70cf0f8c0834d36fc1eff6b6a06dca0c6383d5e06e8bdfbed6b82ee747176ca9792
|
data/app/models/cats/core/hrp.rb
CHANGED
@@ -5,6 +5,8 @@ module Cats
|
|
5
5
|
belongs_to :woreda, -> { where(location_type: Cats::Core::Location::WOREDA) }, class_name: 'Cats::Core::Location'
|
6
6
|
belongs_to :operator
|
7
7
|
|
8
|
+
has_many :hrp_item_details
|
9
|
+
|
8
10
|
validates :beneficiaries, presence: true, numericality: { greater_than: 0 }
|
9
11
|
validates :hrp_id, uniqueness: { scope: :woreda_id }
|
10
12
|
|
@@ -12,7 +12,8 @@ module Cats
|
|
12
12
|
|
13
13
|
has_ancestry
|
14
14
|
|
15
|
-
validates :name, :location_type, presence: true
|
15
|
+
validates :code, :name, :location_type, presence: true
|
16
|
+
validates :code, uniqueness: true
|
16
17
|
validates :location_type, inclusion: { in: LOCATION_TYPES }
|
17
18
|
validate :validate_location_parent
|
18
19
|
|
@@ -6,8 +6,12 @@ class CreateCatsCoreHrps < ActiveRecord::Migration[6.1]
|
|
6
6
|
t.string :season, null: false
|
7
7
|
t.string :status, null: false, default: 'Draft'
|
8
8
|
|
9
|
-
t.references :
|
9
|
+
t.references :program,
|
10
10
|
null: false,
|
11
|
+
index: { name: 'program_on_hrp_indx' },
|
12
|
+
foreign_key: { to_table: :cats_core_programs }
|
13
|
+
t.references :ration,
|
14
|
+
null: true,
|
11
15
|
index: { name: 'ration_on_hrp_indx' },
|
12
16
|
foreign_key: { to_table: :cats_core_rations }
|
13
17
|
|
@@ -5,10 +5,6 @@ class CreateCatsCoreHrpItemDetails < ActiveRecord::Migration[6.1]
|
|
5
5
|
null: false,
|
6
6
|
index: { name: 'hi_on_hid_indx' },
|
7
7
|
foreign_key: { to_table: :cats_core_hrp_items }
|
8
|
-
t.references :hrp_ration,
|
9
|
-
null: false,
|
10
|
-
index: { name: 'hr_on_hid_indx' },
|
11
|
-
foreign_key: { to_table: :cats_core_hrp_rations }
|
12
8
|
t.references :ration_item,
|
13
9
|
null: false,
|
14
10
|
index: { name: 'ri_on_hid_indx' },
|
data/lib/cats/core/version.rb
CHANGED
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.
|
4
|
+
version: 1.0.42
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Henock L.
|
@@ -243,7 +243,6 @@ files:
|
|
243
243
|
- app/models/cats/core/hrp.rb
|
244
244
|
- app/models/cats/core/hrp_item.rb
|
245
245
|
- app/models/cats/core/hrp_item_detail.rb
|
246
|
-
- app/models/cats/core/hrp_ration.rb
|
247
246
|
- app/models/cats/core/location.rb
|
248
247
|
- app/models/cats/core/menu.rb
|
249
248
|
- app/models/cats/core/menu_item.rb
|
@@ -296,7 +295,6 @@ files:
|
|
296
295
|
- db/migrate/20210717031343_create_cats_core_ration_items.rb
|
297
296
|
- db/migrate/20210717031810_create_cats_core_hrps.rb
|
298
297
|
- db/migrate/20210717032024_create_cats_core_hrp_items.rb
|
299
|
-
- db/migrate/20210717032106_create_cats_core_hrp_rations.rb
|
300
298
|
- db/migrate/20210717032240_create_cats_core_hrp_item_details.rb
|
301
299
|
- db/migrate/20210717032330_create_cats_core_donations.rb
|
302
300
|
- db/migrate/20210717032602_create_cats_core_gift_certificates.rb
|
@@ -333,7 +331,6 @@ files:
|
|
333
331
|
- spec/factories/cats/core/gift_certificates.rb
|
334
332
|
- spec/factories/cats/core/hrp_item_details.rb
|
335
333
|
- spec/factories/cats/core/hrp_items.rb
|
336
|
-
- spec/factories/cats/core/hrp_rations.rb
|
337
334
|
- spec/factories/cats/core/hrps.rb
|
338
335
|
- spec/factories/cats/core/locations.rb
|
339
336
|
- spec/factories/cats/core/menu_items.rb
|
@@ -1,17 +0,0 @@
|
|
1
|
-
class CreateCatsCoreHrpRations < ActiveRecord::Migration[6.1]
|
2
|
-
def change
|
3
|
-
create_table :cats_core_hrp_rations do |t|
|
4
|
-
t.references :hrp,
|
5
|
-
null: false,
|
6
|
-
index: { name: 'hrp_on_hr_indx' },
|
7
|
-
foreign_key: { to_table: :cats_core_hrps }
|
8
|
-
t.references :ration,
|
9
|
-
null: false,
|
10
|
-
index: { name: 'ration_on_hr_indx' },
|
11
|
-
foreign_key: { to_table: :cats_core_rations }
|
12
|
-
|
13
|
-
t.timestamps
|
14
|
-
end
|
15
|
-
add_index(:cats_core_hrp_rations, :hrp_id, unique: true)
|
16
|
-
end
|
17
|
-
end
|