cats_core 1.3.13 → 1.3.14

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: d8384e95d3bf98191d6f0fb04ce96f6180daf53d653d954ef1470282bf3b4782
4
- data.tar.gz: 00a0000dba254d8f02dcb8f97fe37b268137d1fe19e03f5c385f2724cb03442b
3
+ metadata.gz: 4be4eb5f572d4c38a09f3ddfb775497fd81c0c9e3a9053be1f03bfee51730308
4
+ data.tar.gz: 4bea5f8744afffa22bad84782ba5e40ef433a31b7c11719da8e910d849803d4c
5
5
  SHA512:
6
- metadata.gz: 2d6cdb1dcd812695e16f53ee1a613a834fa7683eb982d54b62cd1662a2082f147b0000ba2fa7453a7fedf5e5a003f94197eadeca05b7768fa104a9fb4655ab53
7
- data.tar.gz: 7426544df6c7c89477936e11cff07b9ac047c46617b199e02853822cb67260d5b94e08816b51dd7c881173d85e0700a4ddcc3d3a4ab01523f42b2a6ae4e591a6
6
+ metadata.gz: f600c4c2170e448936f7860659533d22039b6815a4890cb9d0af81476c12f9ef7d28c5828887c73f146b44caa6b191bc57101f8b78a85521117e8c0b027ac1f3
7
+ data.tar.gz: 3153dc2e38a2d6f33ac3817ad67250a77a308c8ba3c67d4ced336f6aecea9bc9da64c6b35fc055c77a112f92f1dea5f2e2e618579fe7fe8b1e13e83f83c04838
@@ -5,6 +5,7 @@ module Cats
5
5
  belongs_to :region, class_name: 'Cats::Core::Location'
6
6
 
7
7
  has_many :monthly_plan_items
8
+ has_many :monthly_plan_item_details, through: :monthly_plan_items
8
9
  has_many :monthly_rations
9
10
 
10
11
  validates :reference_no, presence: true, uniqueness: true
@@ -2,7 +2,7 @@ module Cats
2
2
  module Core
3
3
  class MonthlyPlanItemDetail < ApplicationRecord
4
4
  belongs_to :monthly_plan_item
5
- belongs_to :ration_item
5
+ belongs_to :monthly_ration
6
6
 
7
7
  validates :amount, presence: true, numericality: { greater_than: 0 }
8
8
  end
@@ -9,11 +9,13 @@ module Cats
9
9
 
10
10
  BELG = 'Belg'.freeze
11
11
  MEHER = 'Meher'.freeze
12
- SEASONS = [BELG, MEHER].freeze
12
+ ANNUAL = 'Annual'.freeze
13
+ SEASONS = [BELG, MEHER, ANNUAL].freeze
13
14
 
14
15
  belongs_to :program
15
16
  belongs_to :ration, optional: true
16
17
  has_many :plan_items
18
+ has_many :plan_item_details, through: :plan_items
17
19
 
18
20
  validates :reference_no, :year, :status, presence: true
19
21
  validates :season, presence: true, inclusion: { in: SEASONS }
@@ -5,10 +5,10 @@ class CreateCatsCoreMonthlyPlanItemDetails < ActiveRecord::Migration[6.1]
5
5
  null: false,
6
6
  index: { name: 'mpi_on_mpid_indx' },
7
7
  foreign_key: { to_table: :cats_core_monthly_plan_items }
8
- t.references :ration_item,
8
+ t.references :monthly_ration,
9
9
  null: false,
10
- index: { name: 'ri_on_mpid_indx' },
11
- foreign_key: { to_table: :cats_core_ration_items }
10
+ index: { name: 'ri_on_mr_indx' },
11
+ foreign_key: { to_table: :cats_core_monthly_rations }
12
12
  t.float :amount, null: false
13
13
 
14
14
  t.timestamps
@@ -1,5 +1,5 @@
1
1
  module Cats
2
2
  module Core
3
- VERSION = '1.3.13'.freeze
3
+ VERSION = '1.3.14'.freeze
4
4
  end
5
5
  end
@@ -1,7 +1,7 @@
1
1
  FactoryBot.define do
2
2
  factory :monthly_plan_item_detail, class: 'Cats::Core::MonthlyPlanItemDetail' do
3
3
  monthly_plan_item
4
- ration_item
4
+ monthly_ration
5
5
  amount { 150 }
6
6
  end
7
7
  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.3.13
4
+ version: 1.3.14
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-01-10 00:00:00.000000000 Z
11
+ date: 2022-01-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: active_model_serializers
@@ -385,9 +385,9 @@ files:
385
385
  - db/migrate/20211229160129_create_cats_core_commodity_substitutions.rb
386
386
  - db/migrate/20220103152802_create_cats_core_tenderers.rb
387
387
  - db/migrate/20220107121752_create_cats_core_monthly_plans.rb
388
+ - db/migrate/20220107124630_create_cats_core_monthly_rations.rb
388
389
  - db/migrate/20220107125025_create_cats_core_monthly_plan_items.rb
389
390
  - db/migrate/20220107132433_create_cats_core_monthly_plan_item_details.rb
390
- - db/migrate/20220107224630_create_cats_core_monthly_rations.rb
391
391
  - lib/cats/core.rb
392
392
  - lib/cats/core/engine.rb
393
393
  - lib/cats/core/version.rb