unidom-inventory 0.2 → 0.3
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/README.md +10 -0
- data/app/models/unidom/inventory/concerns/as_store.rb +15 -0
- data/app/models/unidom/inventory/concerns/as_stored.rb +15 -0
- data/app/models/unidom/inventory/grouped_inventory_item.rb +1 -0
- data/app/models/unidom/inventory/serialized_inventory_item.rb +1 -0
- data/lib/unidom/inventory/version.rb +1 -1
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6a3df694f60873ba0b90f9888dc028dd96728d1b
|
4
|
+
data.tar.gz: 62747b549a23466fe83ba677a298499508d2aeaf
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c59fced69360cf4d7f96fbb19aac165f73a06aad97a10eeadb43f49a122ba0874ce30dfbc1c995d6d52b479d726d5e883173fdeef2e5987b14206cf7eb85fae4
|
7
|
+
data.tar.gz: 933d5fbca5f946d5774efa31f8f1005e95e55acc84cf663eddd226e07eb1bf9bbaf9b1331461502aa6a2ef835fce5d263dc2d11160fe8940fc7a63948fa366b9
|
data/README.md
CHANGED
@@ -46,3 +46,13 @@ include Unidom::Inventory::AsInventoryItem
|
|
46
46
|
The As Inventory Item concern do the following tasks for the includer automatically:
|
47
47
|
1. Define the belongs_to :stored macro as: ``belongs_to :stored, polymorphic: true``
|
48
48
|
2. Define the belongs_to :store macro as: ``belongs_to :store, polymorphic: true``
|
49
|
+
|
50
|
+
### As Store concern
|
51
|
+
The As Store concern do the following tasks for the includer automatically:
|
52
|
+
1. Define the has_many :grouped_inventory_items macro as: ``has_many :grouped_inventory_items, class_name: 'Unidom::Inventory::GroupedInventoryItem', foreign_key: :store_id``
|
53
|
+
2. Define the has_many :serialized_inventory_items macro as: ``has_many :serialized_inventory_items, class_name: 'Unidom::Inventory::SerializedInventoryItem', foreign_key: :store_id``
|
54
|
+
|
55
|
+
### As Stored concern
|
56
|
+
The As Stored concern do the following tasks for the includer automatically:
|
57
|
+
1. Define the has_many :grouped_inventory_items macro as: ``has_many :grouped_inventory_items, class_name: 'Unidom::Inventory::GroupedInventoryItem', foreign_key: :stored_id``
|
58
|
+
2. Define the has_many :serialized_inventory_items macro as: ``has_many :serialized_inventory_items, class_name: 'Unidom::Inventory::SerializedInventoryItem', foreign_key: :stored_id``
|
@@ -0,0 +1,15 @@
|
|
1
|
+
module Unidom::Inventory::Concerns::AsStore
|
2
|
+
|
3
|
+
extend ActiveSupport::Concern
|
4
|
+
|
5
|
+
included do |includer|
|
6
|
+
|
7
|
+
has_many :grouped_inventory_items, class_name: 'Unidom::Inventory::GroupedInventoryItem', foreign_key: :store_id
|
8
|
+
has_many :serialized_inventory_items, class_name: 'Unidom::Inventory::SerializedInventoryItem', foreign_key: :store_id
|
9
|
+
|
10
|
+
end
|
11
|
+
|
12
|
+
module ClassMethods
|
13
|
+
end
|
14
|
+
|
15
|
+
end
|
@@ -0,0 +1,15 @@
|
|
1
|
+
module Unidom::Inventory::Concerns::AsStored
|
2
|
+
|
3
|
+
extend ActiveSupport::Concern
|
4
|
+
|
5
|
+
included do |includer|
|
6
|
+
|
7
|
+
has_many :grouped_inventory_items, class_name: 'Unidom::Inventory::GroupedInventoryItem', foreign_key: :stored_id
|
8
|
+
has_many :serialized_inventory_items, class_name: 'Unidom::Inventory::SerializedInventoryItem', foreign_key: :stored_id
|
9
|
+
|
10
|
+
end
|
11
|
+
|
12
|
+
module ClassMethods
|
13
|
+
end
|
14
|
+
|
15
|
+
end
|
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: '0.
|
4
|
+
version: '0.3'
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Topbit Du
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-09-
|
11
|
+
date: 2016-09-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: unidom-common
|
@@ -41,6 +41,8 @@ files:
|
|
41
41
|
- app/controllers/unidom/inventory/application_controller.rb
|
42
42
|
- app/helpers/unidom/inventory/application_helper.rb
|
43
43
|
- app/models/unidom/inventory/concerns/as_inventory_item.rb
|
44
|
+
- app/models/unidom/inventory/concerns/as_store.rb
|
45
|
+
- app/models/unidom/inventory/concerns/as_stored.rb
|
44
46
|
- app/models/unidom/inventory/grouped_inventory_item.rb
|
45
47
|
- app/models/unidom/inventory/serialized_inventory_item.rb
|
46
48
|
- app/views/layouts/unidom/inventory/application.html.erb
|