warehouse_models 0.1.0 → 0.1.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 71381758030f0001278098f53abadef6ea2bf1614bb2c64106f3222978ec93e4
4
- data.tar.gz: a71bd153352289f120f0237b8e688049c6155b6d4d93a69cef4c8a1d118c408b
3
+ metadata.gz: 8e299c2c3a3f579e830eb96f6414be6afca5023d30bc953c741a66186c78624c
4
+ data.tar.gz: 713baf7a17bc091ae37d79b8fcfefb3c84341ca3806a0d5d4762de48825815ff
5
5
  SHA512:
6
- metadata.gz: b3276e293e0f81714a67b8b02264a8a10cb254a3257e77e3d5a5e637d697e37f09521df12718ce081fddbab62395efc81456b53816e641ca753506b34f1bddef
7
- data.tar.gz: dfa226e40dabe50fdfd05fc107cebc6abd850206e364f1d98f8510b985e39f166acc9d252aae4d7c8397245f7dded10313608665d48ab7b7f7816d9344960d85
6
+ metadata.gz: dc04b2e0c09ff34d527c8ca3f7b41ee8b481b53b8733fbc652dca3dc4452852c670959d91750a9fda7d54479ce188554ad75706f1bec7448fb27f85b4dee5eb8
7
+ data.tar.gz: 87e1f906b02272c51843f6212fb41ef1d72878aae63a4cad98481f7ae1f67e3215d0df726531ae58b3efd6b7ecff0f0ca957448b58f148a8122daeb5c1ee79c5
@@ -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.1'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
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.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kevin Ivander
@@ -60,10 +60,10 @@ 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_space.rb
65
+ - lib/models/warehouse_space_mutation.rb
66
+ - lib/models/warehouse_space_mutation_action.rb
67
67
  - lib/warehouse_models.rb
68
68
  - lib/warehouse_models/version.rb
69
69
  homepage:
@@ -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
@@ -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,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