cats_core 1.0.30 → 1.0.31

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 0e916c12f4c3ac194aee51c1692ddba4484e234e64f020565d72e4bea7081c4e
4
- data.tar.gz: 28e582506d6bbbca6e33bc3f84bc698f9652e3f57684b4c14f15722e0f65ff7f
3
+ metadata.gz: 92c92ad5a8c3217ca857e5d95aaddde5ad9556b25c206614f2744e5d696f2ee4
4
+ data.tar.gz: fe266e3f9f932fe21b4f4996fadcc505c2d1699c840a309fa2d32c753a4a4dfd
5
5
  SHA512:
6
- metadata.gz: d3baf1a07032560ee3136ff454fb4ab21db27d17afdd8eeabe826b4d49c811d261f0a7880c4ae80bafabe03d66ab8a0b699a49fe66fd123a5618b1d3c9dcd285
7
- data.tar.gz: f2633626ae8ba4c082618c0406657e0b4378af44d97c5416b329326aaf3dd77584b095541cd257b12698df525ab235b165f147a814dcbf3ca2049869e07a30e0
6
+ metadata.gz: 8614644d7542857a67b1377eab58bdae75dfca934e7e044af12efc54a0cd5b4a11cc6578d36adffcc8fb025853a14bd20aeaf35e331dbdbbc061816eb52a7537
7
+ data.tar.gz: 7e81ca5270047990027b0a139df28a4a73814fce52df296734a3519f89f0d4b1e251a659e262ffaa4f68ed874fc4302112b62cd000416e5057c9bf65d3fb2eaf
@@ -6,6 +6,7 @@ module Cats
6
6
  belongs_to :source, class_name: 'Cats::Core::Location'
7
7
 
8
8
  validates :commodity_status, presence: true
9
+ validates :reference_no, presence: true, uniqueness: true
9
10
  validates :quantity, presence: true, numericality: { greater_than: 0 }
10
11
  validates :commodity_status, inclusion: { in: Cats::Core::Commodity::COMMODITY_STATUSES }
11
12
 
@@ -13,6 +13,9 @@ module Cats
13
13
 
14
14
  errors.add(:base, 'source and destination cannot be the same') if allocation.source == destination
15
15
  end
16
+
17
+ delegate(:name, to: :destination, prefix: true)
18
+ delegate(:reference_no, to: :allocation, prefix: true)
16
19
  end
17
20
  end
18
21
  end
@@ -5,6 +5,8 @@ module Cats
5
5
 
6
6
  validates :reference_no, :request_date, presence: true
7
7
  validates :reference_no, uniqueness: true
8
+
9
+ delegate(:batch_no, to: :commodity, prefix: true)
8
10
  end
9
11
  end
10
12
  end
@@ -1,6 +1,7 @@
1
1
  class CreateCatsCoreAllocations < ActiveRecord::Migration[6.1]
2
2
  def change
3
3
  create_table :cats_core_allocations do |t|
4
+ t.string :reference_no, unique: true
4
5
  t.references :rhn_request,
5
6
  null: true,
6
7
  index: { name: 'rr_on_allocation_indx' },
@@ -1,5 +1,5 @@
1
1
  module Cats
2
2
  module Core
3
- VERSION = '1.0.30'.freeze
3
+ VERSION = '1.0.31'.freeze
4
4
  end
5
5
  end
@@ -1,5 +1,6 @@
1
1
  FactoryBot.define do
2
2
  factory :allocation, class: 'Cats::Core::Allocation' do
3
+ reference_no { FFaker::Name.name }
3
4
  rhn_request { nil }
4
5
  commodity
5
6
  source factory: :location
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.30
4
+ version: 1.0.31
5
5
  platform: ruby
6
6
  authors:
7
7
  - Henock L.