cats_core 1.0.37 → 1.0.38
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/app/models/cats/core/hrp_item.rb +0 -1
- data/app/models/cats/core/hrp_item_detail.rb +12 -0
- data/app/models/cats/core/hrp_ration.rb +10 -0
- data/db/migrate/20210717032024_create_cats_core_hrp_items.rb +0 -1
- data/db/migrate/20210717032106_create_cats_core_hrp_rations.rb +17 -0
- data/db/migrate/20210717032240_create_cats_core_hrp_item_details.rb +22 -0
- data/lib/cats/core/version.rb +1 -1
- data/spec/factories/cats/core/hrp_item_details.rb +8 -0
- data/spec/factories/cats/core/hrp_items.rb +0 -1
- data/spec/factories/cats/core/hrp_rations.rb +6 -0
- metadata +8 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f003ab02e18c4d6748354703954b989a2854beb06d6cedde9a1417dd033b6b0d
|
4
|
+
data.tar.gz: ec1a54e9e760cf5a8c84109d526b7a6da50696b31bd3647a82b910e108dca482
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d21df2b1e4f3052deda19c879fbc0d3c4f4d5bf9754a7c91e6b7260a7ff1cf64292a68da01d847a9caec74d933cded52952d3de3c627afcd9b6a0bd426019cd0
|
7
|
+
data.tar.gz: 2afec4b8dedd8eb129bd3ad61cc3bcf766c69eb1fbc0d45ef12f18085b62db3856bbc298720be52cc63f040451904cd966cfc6b64fcf6d57037b76254b63f54b
|
@@ -6,7 +6,6 @@ module Cats
|
|
6
6
|
belongs_to :operator
|
7
7
|
|
8
8
|
validates :beneficiaries, presence: true, numericality: { greater_than: 0 }
|
9
|
-
validates :commodity_amount, presence: true, numericality: { greater_than: 0 }
|
10
9
|
validates :hrp_id, uniqueness: { scope: :woreda_id }
|
11
10
|
|
12
11
|
delegate(:name, to: :woreda, prefix: true)
|
@@ -0,0 +1,12 @@
|
|
1
|
+
module Cats
|
2
|
+
module Core
|
3
|
+
class HrpItemDetail < ApplicationRecord
|
4
|
+
belongs_to :hrp_item
|
5
|
+
belongs_to :hrp_ration
|
6
|
+
belongs_to :ration_item
|
7
|
+
|
8
|
+
validates :amount, presence: true, numericality: { greater_than: 0 }
|
9
|
+
validates :hrp_item_id, uniqueness: { scope: :ration_item_id }
|
10
|
+
end
|
11
|
+
end
|
12
|
+
end
|
@@ -10,7 +10,6 @@ class CreateCatsCoreHrpItems < ActiveRecord::Migration[6.1]
|
|
10
10
|
index: { name: 'woreda_on_hrp_items_idnx' },
|
11
11
|
foreign_key: { to_table: :cats_core_locations }
|
12
12
|
t.integer :beneficiaries, null: false
|
13
|
-
t.float :commodity_amount, null: false
|
14
13
|
t.references :operator,
|
15
14
|
null: false,
|
16
15
|
index: { name: 'operator_on_hrp_items_indx' },
|
@@ -0,0 +1,17 @@
|
|
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
|
@@ -0,0 +1,22 @@
|
|
1
|
+
class CreateCatsCoreHrpItemDetails < ActiveRecord::Migration[6.1]
|
2
|
+
def change
|
3
|
+
create_table :cats_core_hrp_item_details do |t|
|
4
|
+
t.references :hrp_item,
|
5
|
+
null: false,
|
6
|
+
index: { name: 'hi_on_hid_indx' },
|
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
|
+
t.references :ration_item,
|
13
|
+
null: false,
|
14
|
+
index: { name: 'ri_on_hid_indx' },
|
15
|
+
foreign_key: { to_table: :cats_core_ration_items }
|
16
|
+
t.float :amount, null: false
|
17
|
+
|
18
|
+
t.timestamps
|
19
|
+
end
|
20
|
+
add_index(:cats_core_hrp_item_details, [:hrp_item_id, :ration_item_id], unique: true, name: 'hii_rii_on_hid_indx')
|
21
|
+
end
|
22
|
+
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.0.
|
4
|
+
version: 1.0.38
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Henock L.
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-09-
|
11
|
+
date: 2021-09-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: active_model_serializers
|
@@ -242,6 +242,8 @@ files:
|
|
242
242
|
- app/models/cats/core/gift_certificate.rb
|
243
243
|
- app/models/cats/core/hrp.rb
|
244
244
|
- app/models/cats/core/hrp_item.rb
|
245
|
+
- app/models/cats/core/hrp_item_detail.rb
|
246
|
+
- app/models/cats/core/hrp_ration.rb
|
245
247
|
- app/models/cats/core/location.rb
|
246
248
|
- app/models/cats/core/menu.rb
|
247
249
|
- app/models/cats/core/menu_item.rb
|
@@ -294,6 +296,8 @@ files:
|
|
294
296
|
- db/migrate/20210717031343_create_cats_core_ration_items.rb
|
295
297
|
- db/migrate/20210717031810_create_cats_core_hrps.rb
|
296
298
|
- db/migrate/20210717032024_create_cats_core_hrp_items.rb
|
299
|
+
- db/migrate/20210717032106_create_cats_core_hrp_rations.rb
|
300
|
+
- db/migrate/20210717032240_create_cats_core_hrp_item_details.rb
|
297
301
|
- db/migrate/20210717032330_create_cats_core_donations.rb
|
298
302
|
- db/migrate/20210717032602_create_cats_core_gift_certificates.rb
|
299
303
|
- db/migrate/20210717032855_create_cats_core_purchase_orders.rb
|
@@ -327,7 +331,9 @@ files:
|
|
327
331
|
- spec/factories/cats/core/donations.rb
|
328
332
|
- spec/factories/cats/core/donors.rb
|
329
333
|
- spec/factories/cats/core/gift_certificates.rb
|
334
|
+
- spec/factories/cats/core/hrp_item_details.rb
|
330
335
|
- spec/factories/cats/core/hrp_items.rb
|
336
|
+
- spec/factories/cats/core/hrp_rations.rb
|
331
337
|
- spec/factories/cats/core/hrps.rb
|
332
338
|
- spec/factories/cats/core/locations.rb
|
333
339
|
- spec/factories/cats/core/menu_items.rb
|