cats_core 1.4.39 → 1.4.40

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: a86860a6e6a86d7d133ab9a050bffdd675d00c1fad85e9af8b9fabf24183711d
4
- data.tar.gz: 23001d95a8ce470d196ab560dd72d782f080ed8fed7e9067a12674b06084cf35
3
+ metadata.gz: f351b09b0928289a2d7a7eba97b0784bb459bec5e830a81648e1a6248d187cfb
4
+ data.tar.gz: 968878625a82ba3e0dca6b11264be31955c7e237c255684150d47f71d2b59ad6
5
5
  SHA512:
6
- metadata.gz: 10324cc46243b87345e485e9f176cd1b4a9acc277d8c26aa5b1372c3dc211fa4e4a3f473e81ad94c1bcba0f67c8a9cbb988b5648f4bd70063ab10da0c4865636
7
- data.tar.gz: 0c530f68241d07329f96a399b2fcac5cffc30bb549c5ddb605739a49db2150cbef97b24e290459232d05f4bf67390ecf66c706bc2f552628743853b4d7bec86b
6
+ metadata.gz: 6d2f3cff48d29e0c9e2fb370be54d735b2ac0e9e2c6d549b43bfb0c181efb17bf7dc20d2a3420240e258fbd6508e7e5347e91ee59fb2cdca8d93dbed95df6edc
7
+ data.tar.gz: d1d76375ad48d4bba448318854cca83b14ad7955e3c19ca142bfa56dd9231449e042681037daae808327b1a30518514b22bbe2653abbf8d87ccf45406bb8b0dd
@@ -11,7 +11,7 @@ module Cats
11
11
  belongs_to :commodity_category, optional: true
12
12
  belongs_to :unit_of_measure, optional: true
13
13
 
14
- validates :reference_no, :amount, :donation_type, :donated_on, :agency, presence: true
14
+ validates :reference_no, :amount, :donation_type, :donated_on, presence: true
15
15
  validates :reference_no, uniqueness: true
16
16
  validates :donation_type, inclusion: { in: DONATION_TYPES }
17
17
  validates :currency, presence: true, if: -> { donation_type == CASH }
@@ -2,10 +2,13 @@ module Cats
2
2
  module Core
3
3
  class Project < ApplicationRecord
4
4
  belongs_to :source, polymorphic: true
5
+ belongs_to :program
5
6
 
6
7
  validates :code, presence: true, uniqueness: true
7
8
  validates :year, :implementing_agency, presence: true
8
9
  validates :year, numericality: { greater_than: 2000 }
10
+
11
+ delegate(:code, to: :program, prefix: true)
9
12
  end
10
13
  end
11
14
  end
@@ -6,7 +6,6 @@ class CreateCatsCoreDonations < ActiveRecord::Migration[6.1]
6
6
  t.string :donation_type, null: false
7
7
  t.string :shipping_reference
8
8
  t.date :donated_on, null: false
9
- t.string :agency, null: false
10
9
  t.references :donor,
11
10
  null: false,
12
11
  index: { name: 'donor_on_donation_indx' },
@@ -4,6 +4,10 @@ class CreateCatsCoreProjects < ActiveRecord::Migration[7.0]
4
4
  t.string :code, unique: true
5
5
  t.string :description
6
6
  t.references :source, polymorphic: true
7
+ t.references :program,
8
+ null: false,
9
+ index: { name: 'program_on_projects_indx' },
10
+ foreign_key: { to_table: :cats_core_programs }
7
11
  t.integer :year, null: false
8
12
  t.string :implementing_agency, null: false
9
13
 
@@ -1,5 +1,5 @@
1
1
  module Cats
2
2
  module Core
3
- VERSION = '1.4.39'.freeze
3
+ VERSION = '1.4.40'.freeze
4
4
  end
5
5
  end
@@ -5,7 +5,6 @@ FactoryBot.define do
5
5
  donation_type { Cats::Core::Donation::KIND }
6
6
  shipping_reference { FFaker::Name.name }
7
7
  donated_on { Date.today }
8
- agency { 'WFP' }
9
8
  donor
10
9
  plan
11
10
  amount { 100 }
@@ -3,6 +3,7 @@ FactoryBot.define do
3
3
  code { FFaker::Name.name }
4
4
  description { FFaker::Name.name }
5
5
  source factory: :gift_certificate
6
+ program
6
7
  year { 2022 }
7
8
  implementing_agency { FFaker::Name.name }
8
9
  end
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.4.39
4
+ version: 1.4.40
5
5
  platform: ruby
6
6
  authors:
7
7
  - Henock L.