cats_core 1.1.36 → 1.1.37

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: 9d66e9f780b4e36013c3eac6a0c319e61270199d621eea8cc1747451eb09e95b
4
- data.tar.gz: 83c8aee6ba3e4a15d3aa6a0255f0c8a6aead3247fed994e5ced103c91cc1d314
3
+ metadata.gz: f07fe2e24b72c5cf2c4c7d7c9acd92332e6e7a80b4d9305fdffcbb94365fb67e
4
+ data.tar.gz: 6c343a483c11b17757966c650fa355a541a62483eafa9d6ad5b5428ebb1aef63
5
5
  SHA512:
6
- metadata.gz: b77f6a0923079b2e847b263602e42fb489245f15442b11ccd0509d4c6b3790b1f3950469557a686d0b4cbeb9f34c9c94dc14c82e853e0d2d064d42c5db3bd4e8
7
- data.tar.gz: ac19f2ff28600eaa8d580bef4d6ad8fdec01ea0511f163d486d8bc3397e67d95eab82a79c32977b01e88952f789d53198a40c599fc977c14a623f4cf3eb4da12
6
+ metadata.gz: 5c7a27a3e6babd99f6e331c63d6d79ecfb6af34e5c6ae746ccd538d11e1ea62e48ea9c6b4b84eb5d1500da1466992f2acae40297127e5822c12b4f8ed418a728
7
+ data.tar.gz: 930ccb77011e1cabc7ce9851fe22584f50346d1494d4556df7df90159fb9f2d99b3340c0f9ff1f7f5cc0a7b334f5274e74b67191d48abecf709f04af27b553b5
@@ -22,6 +22,7 @@ module Cats
22
22
 
23
23
  allocated = AllocationItem.where(allocation: allocation).sum(:quantity)
24
24
  remaining = allocation.quantity - allocated
25
+ remaining += quantity_was if quantity_was
25
26
  errors.add(:quantity, "exceeds allocated quantity. Maximum allowed is #{remaining}") if quantity > remaining
26
27
  end
27
28
 
@@ -32,6 +32,7 @@ module Cats
32
32
 
33
33
  dispatched = Dispatch.where(allocation_item: allocation_item).sum(:quantity)
34
34
  remaining = allocation_item.quantity - dispatched
35
+ remaining += quantity_was if quantity_was
35
36
  errors.add(:quantity, "exceeds allocated quantity. Maximum allowed is #{remaining}") if quantity > remaining
36
37
  end
37
38
 
@@ -1,5 +1,5 @@
1
1
  module Cats
2
2
  module Core
3
- VERSION = '1.1.36'.freeze
3
+ VERSION = '1.1.37'.freeze
4
4
  end
5
5
  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.1.36
4
+ version: 1.1.37
5
5
  platform: ruby
6
6
  authors:
7
7
  - Henock L.