warehouse_models 0.1.0 → 0.1.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/models/warehouse_mapping.rb +6 -0
- data/lib/models/warehouse_space.rb +20 -0
- data/lib/models/warehouse_space_mutation.rb +6 -0
- data/lib/models/warehouse_space_mutation_action.rb +5 -0
- data/lib/warehouse_models/version.rb +1 -1
- data/lib/warehouse_models.rb +1 -0
- metadata +12 -11
- data/lib/models/warehouse/space/mutation/action.rb +0 -11
- data/lib/models/warehouse/space/mutation.rb +0 -10
- data/lib/models/warehouse/space.rb +0 -25
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d6f7506e77a942a942d82e9ec0c844270bb273aa4e79617bbe55759a0a5a8bb0
|
4
|
+
data.tar.gz: 58dcff679c72f6716a89dbd4eeb818117c242be0bfc394043baf821c42cfbc2c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: aabacd1249a953db5c0ed435112a8d4e2f608b1deac49dc1ba1e03ef799f33c6f20b7f3144ca1d8c383c45e213cea7b5a301605f900c0546346f9d72e8188971
|
7
|
+
data.tar.gz: 41943c7e96f18cca61cecaaf66b5cc799cd75bc97c6e07fe44c81a48bfe80ff18148e5d21f0d0505fafbcb2e544b14e2bd77861f97a031a2a0f45de175778a0a
|
@@ -0,0 +1,20 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
class WarehouseSpace < WarehouseAplicationRecord
|
4
|
+
belongs_to :warehouse
|
5
|
+
has_many :mutations,
|
6
|
+
class_name: 'WarehouseSpaceMutation',
|
7
|
+
foreign_key: :warehouse_space_id,
|
8
|
+
dependent: :destroy
|
9
|
+
|
10
|
+
validates_presence_of :warehouse
|
11
|
+
validates_presence_of :quantity
|
12
|
+
|
13
|
+
validates_numericality_of :quantity,
|
14
|
+
only_integer: true,
|
15
|
+
greater_than_or_equal_to: 0,
|
16
|
+
if: :new_record?
|
17
|
+
validates_numericality_of :quantity,
|
18
|
+
only_integer: true,
|
19
|
+
unless: :new_record?
|
20
|
+
end
|
data/lib/warehouse_models.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: warehouse_models
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Kevin Ivander
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2022-01-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -52,7 +52,7 @@ dependencies:
|
|
52
52
|
- - "~>"
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: '3.0'
|
55
|
-
description:
|
55
|
+
description:
|
56
56
|
email:
|
57
57
|
- ivanderkevin1@gmail.com
|
58
58
|
executables: []
|
@@ -60,17 +60,18 @@ extensions: []
|
|
60
60
|
extra_rdoc_files: []
|
61
61
|
files:
|
62
62
|
- lib/models/warehouse.rb
|
63
|
-
- lib/models/warehouse/space.rb
|
64
|
-
- lib/models/warehouse/space/mutation.rb
|
65
|
-
- lib/models/warehouse/space/mutation/action.rb
|
66
63
|
- lib/models/warehouse_application_record.rb
|
64
|
+
- lib/models/warehouse_mapping.rb
|
65
|
+
- lib/models/warehouse_space.rb
|
66
|
+
- lib/models/warehouse_space_mutation.rb
|
67
|
+
- lib/models/warehouse_space_mutation_action.rb
|
67
68
|
- lib/warehouse_models.rb
|
68
69
|
- lib/warehouse_models/version.rb
|
69
|
-
homepage:
|
70
|
+
homepage:
|
70
71
|
licenses:
|
71
72
|
- MIT
|
72
73
|
metadata: {}
|
73
|
-
post_install_message:
|
74
|
+
post_install_message:
|
74
75
|
rdoc_options: []
|
75
76
|
require_paths:
|
76
77
|
- lib
|
@@ -86,8 +87,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
86
87
|
- !ruby/object:Gem::Version
|
87
88
|
version: '0'
|
88
89
|
requirements: []
|
89
|
-
rubygems_version: 3.0.
|
90
|
-
signing_key:
|
90
|
+
rubygems_version: 3.0.9
|
91
|
+
signing_key:
|
91
92
|
specification_version: 4
|
92
93
|
summary: gem for active record warehouse models
|
93
94
|
test_files: []
|
@@ -1,25 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
class Warehouse
|
4
|
-
class Space < WarehouseAplicationRecord
|
5
|
-
belongs_to :warehouse
|
6
|
-
has_many :mutations,
|
7
|
-
class_name: 'Warehouse::Space::Mutation',
|
8
|
-
foreign_key: :warehouse_space_id,
|
9
|
-
dependent: :destroy
|
10
|
-
|
11
|
-
validates_presence_of :warehouse
|
12
|
-
validates_presence_of :quantity
|
13
|
-
|
14
|
-
validates_numericality_of :quantity,
|
15
|
-
only_integer: true,
|
16
|
-
greater_than_or_equal_to: 0,
|
17
|
-
if: :new_record?
|
18
|
-
validates_numericality_of :quantity,
|
19
|
-
only_integer: true,
|
20
|
-
unless: :new_record?
|
21
|
-
|
22
|
-
before_create :initial_mutation
|
23
|
-
before_destroy :allow_next_update!
|
24
|
-
end
|
25
|
-
end
|