warehouse_models 0.1.0 → 0.1.4

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: 71381758030f0001278098f53abadef6ea2bf1614bb2c64106f3222978ec93e4
4
- data.tar.gz: a71bd153352289f120f0237b8e688049c6155b6d4d93a69cef4c8a1d118c408b
3
+ metadata.gz: d6f7506e77a942a942d82e9ec0c844270bb273aa4e79617bbe55759a0a5a8bb0
4
+ data.tar.gz: 58dcff679c72f6716a89dbd4eeb818117c242be0bfc394043baf821c42cfbc2c
5
5
  SHA512:
6
- metadata.gz: b3276e293e0f81714a67b8b02264a8a10cb254a3257e77e3d5a5e637d697e37f09521df12718ce081fddbab62395efc81456b53816e641ca753506b34f1bddef
7
- data.tar.gz: dfa226e40dabe50fdfd05fc107cebc6abd850206e364f1d98f8510b985e39f166acc9d252aae4d7c8397245f7dded10313608665d48ab7b7f7816d9344960d85
6
+ metadata.gz: aabacd1249a953db5c0ed435112a8d4e2f608b1deac49dc1ba1e03ef799f33c6f20b7f3144ca1d8c383c45e213cea7b5a301605f900c0546346f9d72e8188971
7
+ data.tar.gz: 41943c7e96f18cca61cecaaf66b5cc799cd75bc97c6e07fe44c81a48bfe80ff18148e5d21f0d0505fafbcb2e544b14e2bd77861f97a031a2a0f45de175778a0a
@@ -0,0 +1,6 @@
1
+ # frozen_string_literal: true
2
+
3
+ class WarehouseMapping < WarehouseAplicationRecord
4
+ acts_as_paranoid
5
+ belongs_to :warehouse
6
+ end
@@ -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
@@ -0,0 +1,6 @@
1
+ # frozen_string_literal: true
2
+
3
+ class WarehouseSpaceMutation < WarehouseAplicationRecord
4
+ belongs_to :warehouse_space,
5
+ class_name: 'WarehouseSpace'
6
+ end
@@ -0,0 +1,5 @@
1
+ # frozen_string_literal: true
2
+
3
+ class WarehouseSpaceMutationAction < WarehouseAplicationRecord
4
+ has_many :mutations
5
+ end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module WarehouseModels
4
- VERSION = '0.1.0'
4
+ VERSION = '0.1.4'
5
5
  end
@@ -6,6 +6,7 @@ module WarehouseModels
6
6
  class Error < StandardError; end
7
7
  # Your code goes here...
8
8
  def self.load
9
+ require directory + '/lib/models/warehouse_application_record'
9
10
  files.each { |file| require file }
10
11
  end
11
12
 
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.0
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: 2020-03-03 00:00:00.000000000 Z
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.6
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,11 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- class Warehouse
4
- class Space
5
- class Mutation
6
- class Action < WarehouseAplicationRecord
7
- has_many :mutations
8
- end
9
- end
10
- end
11
- end
@@ -1,10 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- class Warehouse
4
- class Space
5
- class Mutation < WarehouseAplicationRecord
6
- belongs_to :warehouse_space,
7
- class_name: 'Warehouse::Space'
8
- end
9
- end
10
- end
@@ -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