unidom-inventory 1.0 → 1.0.1
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 +4 -4
- data/app/models/unidom/inventory/grouped_inventory_item.rb +2 -2
- data/app/models/unidom/inventory/inventory_item_variance.rb +2 -2
- data/lib/rspec/models/unidom/inventory/grouped_inventory_item_spec.rb +0 -2
- data/lib/rspec/models/unidom/inventory/inventory_item_variance_spec.rb +0 -2
- data/lib/rspec/models/unidom/inventory/serialized_inventory_item_spec.rb +1 -3
- data/lib/unidom/inventory/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6bdac4a21869a3ffda95c4ab54a216342b29134d
|
4
|
+
data.tar.gz: c5e234b4d38366f9bc335161f89bb1284af18d11
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c956e76be390a4575e9a9981b50ce4039c92b0fc48e34499a22a537370a5035076ac875838ecf678bdebfc270c9c4a77ea8daf7a3a075a4e44a4dfee00f1ac66
|
7
|
+
data.tar.gz: 0c4928c27816f8c7fe22a17072ddbd45c920c5b50063eb428a24edc761b839d53c01c7bb17a1d31057f1e4f3e2c15bb5ca68a4f05e634bd6af551567a9f4331a
|
@@ -8,7 +8,7 @@ class Unidom::Inventory::GroupedInventoryItem < Unidom::Inventory::ApplicationRe
|
|
8
8
|
include Unidom::Common::Concerns::ModelExtension
|
9
9
|
include Unidom::Inventory::Concerns::AsInventoryItem
|
10
10
|
|
11
|
-
validates :quantity, presence: true, numericality: true
|
12
|
-
|
11
|
+
#validates :quantity, presence: true, numericality: true
|
12
|
+
validates :quantity, presence: true, numericality: { greater_than_or_equal_to: 0.0, less_than: 1_000_000_000.00 }
|
13
13
|
|
14
14
|
end unless Unidom::Common::Neglection.namespace_neglected? 'Unidom::Inventory::GroupedInventoryItem'
|
@@ -10,8 +10,8 @@ class Unidom::Inventory::InventoryItemVariance < Unidom::Inventory::ApplicationR
|
|
10
10
|
|
11
11
|
include Unidom::Common::Concerns::ModelExtension
|
12
12
|
|
13
|
-
validates :quantity, presence: true, numericality: true
|
14
|
-
|
13
|
+
#validates :quantity, presence: true, numericality: true
|
14
|
+
validates :quantity, presence: true, numericality: { greater_than: -1_000_000_000.00, less_than: 1_000_000_000.00 }
|
15
15
|
|
16
16
|
belongs_to :inventory_item, polymorphic: true
|
17
17
|
belongs_to :reason, polymorphic: true
|
@@ -19,7 +19,6 @@ describe Unidom::Inventory::GroupedInventoryItem, type: :model do
|
|
19
19
|
|
20
20
|
it_behaves_like 'Unidom::Common::Concerns::ModelExtension', model_attributes
|
21
21
|
|
22
|
-
=begin
|
23
22
|
it_behaves_like 'validates', model_attributes, :quantity,
|
24
23
|
{ } => 0,
|
25
24
|
{ quantity: nil } => 2,
|
@@ -41,7 +40,6 @@ describe Unidom::Inventory::GroupedInventoryItem, type: :model do
|
|
41
40
|
{ quantity: 1_000_000_000 } => 1,
|
42
41
|
{ quantity: '1_000_000_000.01' } => 1,
|
43
42
|
{ quantity: 1_000_000_000.01 } => 1
|
44
|
-
=end
|
45
43
|
|
46
44
|
end
|
47
45
|
|
@@ -18,7 +18,6 @@ describe Unidom::Inventory::InventoryItemVariance, type: :model do
|
|
18
18
|
|
19
19
|
it_behaves_like 'Unidom::Common::Concerns::ModelExtension', model_attributes
|
20
20
|
|
21
|
-
=begin
|
22
21
|
it_behaves_like 'validates', model_attributes, :quantity,
|
23
22
|
{ } => 0,
|
24
23
|
{ quantity: nil } => 2,
|
@@ -40,7 +39,6 @@ describe Unidom::Inventory::InventoryItemVariance, type: :model do
|
|
40
39
|
{ quantity: 1_000_000_000 } => 1,
|
41
40
|
{ quantity: '1_000_000_000.01' } => 1,
|
42
41
|
{ quantity: 1_000_000_000.01 } => 1
|
43
|
-
=end
|
44
42
|
|
45
43
|
end
|
46
44
|
|
@@ -17,11 +17,10 @@ describe Unidom::Inventory::SerializedInventoryItem, type: :model do
|
|
17
17
|
serial_number: '123456789012'
|
18
18
|
}
|
19
19
|
|
20
|
-
|
20
|
+
serial_number_max_length = described_class.columns_hash['serial_number'].limit
|
21
21
|
|
22
22
|
it_behaves_like 'Unidom::Common::Concerns::ModelExtension', model_attributes
|
23
23
|
|
24
|
-
=begin
|
25
24
|
it_behaves_like 'validates', model_attributes, :serial_number,
|
26
25
|
{ } => 0,
|
27
26
|
{ serial_number: nil } => 2,
|
@@ -38,7 +37,6 @@ describe Unidom::Inventory::SerializedInventoryItem, type: :model do
|
|
38
37
|
{ serial_number: 'A'*(serial_number_max_length-1) } => 0,
|
39
38
|
{ serial_number: 'A'*serial_number_max_length } => 0,
|
40
39
|
{ serial_number: 'A'*(serial_number_max_length+1) } => 1
|
41
|
-
=end
|
42
40
|
|
43
41
|
end
|
44
42
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: unidom-inventory
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 1.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Topbit Du
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-03-
|
11
|
+
date: 2017-03-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: unidom-common
|