cats_core 1.0.35 → 1.0.36
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/ration.rb +1 -4
- data/app/models/cats/core/ration_item.rb +11 -0
- data/db/migrate/20210717031216_create_cats_core_rations.rb +0 -5
- data/db/migrate/20210717031343_create_cats_core_ration_items.rb +21 -0
- data/lib/cats/core/version.rb +1 -1
- data/spec/factories/cats/core/ration_items.rb +8 -0
- data/spec/factories/cats/core/rations.rb +0 -2
- metadata +4 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c909272a932180976b058fc2514d349d48677862c5bee425d97e1ebb1d92f30e
|
4
|
+
data.tar.gz: 57060b872361ba7f38b5bffe9522241ccb147bb3fac27b7e593288937a771672
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: af510c6f846701bea55bd995f6ccf3d34500c11c8a23cdac2df2f89f258170c4f93fb31c9242eaf927ed3a24a5e499fdd2c995ca1d2c178d9e39c60364e6d072
|
7
|
+
data.tar.gz: 19dff931a8a64a71870263e2193709f541ea530110ac852ef0c751bca2e8739d996c8da2ad53c3465d720ad2167a34ead9c9cca36cd42956db7abecf6b1b37fa
|
@@ -2,11 +2,8 @@ module Cats
|
|
2
2
|
module Core
|
3
3
|
class Ration < ApplicationRecord
|
4
4
|
belongs_to :program
|
5
|
-
belongs_to :commodity_category
|
6
5
|
|
7
|
-
validates :reference_no, :
|
8
|
-
validates :reference_no, uniqueness: true
|
9
|
-
validates :amount, numericality: { greater_than: 0 }
|
6
|
+
validates :reference_no, presence: true, uniqueness: true
|
10
7
|
end
|
11
8
|
end
|
12
9
|
end
|
@@ -6,11 +6,6 @@ class CreateCatsCoreRations < ActiveRecord::Migration[6.1]
|
|
6
6
|
null: false,
|
7
7
|
index: { name: 'program_on_ration_indx' },
|
8
8
|
foreign_key: { to_table: :cats_core_programs }
|
9
|
-
t.references :commodity_category,
|
10
|
-
null: false,
|
11
|
-
index: { name: 'cc_on_ration_indx' },
|
12
|
-
foreign_key: { to_table: :cats_core_commodity_categories }
|
13
|
-
t.float :amount, null: false
|
14
9
|
t.boolean :current, null: false, default: true
|
15
10
|
|
16
11
|
t.timestamps
|
@@ -0,0 +1,21 @@
|
|
1
|
+
class CreateCatsCoreRationItems < ActiveRecord::Migration[6.1]
|
2
|
+
def change
|
3
|
+
create_table :cats_core_ration_items do |t|
|
4
|
+
t.references :commodity_category,
|
5
|
+
null: false,
|
6
|
+
index: { name: 'cc_on_ration_indx' },
|
7
|
+
foreign_key: { to_table: :cats_core_commodity_categories }
|
8
|
+
t.references :ration,
|
9
|
+
null: false,
|
10
|
+
index: { name: 'ri_on_ration_indx' },
|
11
|
+
foreign_key: { to_table: :cats_core_rations }
|
12
|
+
t.references :unit_of_measure,
|
13
|
+
null: false,
|
14
|
+
index: { name: 'uom_on_ration_indx' },
|
15
|
+
foreign_key: { to_table: :cats_core_unit_of_measures }
|
16
|
+
t.float :amount, null: false
|
17
|
+
|
18
|
+
t.timestamps
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
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.36
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Henock L.
|
@@ -250,6 +250,7 @@ files:
|
|
250
250
|
- app/models/cats/core/program.rb
|
251
251
|
- app/models/cats/core/purchase_order.rb
|
252
252
|
- app/models/cats/core/ration.rb
|
253
|
+
- app/models/cats/core/ration_item.rb
|
253
254
|
- app/models/cats/core/receipt.rb
|
254
255
|
- app/models/cats/core/receipt_transaction.rb
|
255
256
|
- app/models/cats/core/rhn_request.rb
|
@@ -290,6 +291,7 @@ files:
|
|
290
291
|
- db/migrate/20210716210905_create_cats_core_suppliers.rb
|
291
292
|
- db/migrate/20210717031108_create_cats_core_donors.rb
|
292
293
|
- db/migrate/20210717031216_create_cats_core_rations.rb
|
294
|
+
- db/migrate/20210717031343_create_cats_core_ration_items.rb
|
293
295
|
- db/migrate/20210717031810_create_cats_core_hrps.rb
|
294
296
|
- db/migrate/20210717032024_create_cats_core_hrp_items.rb
|
295
297
|
- db/migrate/20210717032330_create_cats_core_donations.rb
|
@@ -334,6 +336,7 @@ files:
|
|
334
336
|
- spec/factories/cats/core/operators.rb
|
335
337
|
- spec/factories/cats/core/programs.rb
|
336
338
|
- spec/factories/cats/core/purchase_orders.rb
|
339
|
+
- spec/factories/cats/core/ration_items.rb
|
337
340
|
- spec/factories/cats/core/rations.rb
|
338
341
|
- spec/factories/cats/core/receipt_transactions.rb
|
339
342
|
- spec/factories/cats/core/receipts.rb
|