unidom-product 1.5.1 → 1.6
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 +12 -0
- data/app/models/unidom/product/product.rb +3 -0
- data/app/types/unidom/product/formset.rb +7 -0
- data/config/enum.yml +8 -0
- data/config/locales/enum.zh-CN.yml +5 -0
- data/lib/unidom/product/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 907a1161756dc77c80828a924bf38c303c5e18dd
|
|
4
|
+
data.tar.gz: 20d56aa708474959d89263c746314a04c67fced8
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: ed42995d06c3c6472553a16c4768fe7a514aa7f4ef1c383331cfb06b8c894aa6ee6916c314cd1ff5e543721be494474bd6521ca1cb1144ae8dfc53d523b90834
|
|
7
|
+
data.tar.gz: 714e0bc0d208d271a8a5c511aec0cfe4451494a420f09e8f38d6739658a773c83544d883634f42b594c7d14afe1378c4d48a18cd8155559fcd98f62454fb3362
|
data/README.md
CHANGED
|
@@ -79,3 +79,15 @@ The As Target Product concern do the following tasks for the includer automatica
|
|
|
79
79
|
2. Define the has_many :source_products macro as: ``has_many :source_products, through: :source_product_associatings, source: :source``
|
|
80
80
|
3. Define the #is_associated! method as: ``is_associated!(source, due_to: nil, at: Time.now, ordinal: 1)``
|
|
81
81
|
4. Define the #is_associated? method as: ``is_associated?(source, due_to: nil, at: Time.now)``
|
|
82
|
+
|
|
83
|
+
|
|
84
|
+
|
|
85
|
+
## Enum codes
|
|
86
|
+
|
|
87
|
+
### Formset enum code
|
|
88
|
+
|
|
89
|
+
```ruby
|
|
90
|
+
Unidom::Product::Formset::ware # 货物
|
|
91
|
+
Unidom::Product::Formset::service # 服务
|
|
92
|
+
Unidom::Product::Formset::portfolio # 组合
|
|
93
|
+
```
|
|
@@ -7,10 +7,13 @@ class Unidom::Product::Product < Unidom::Product::ApplicationRecord
|
|
|
7
7
|
include Unidom::Common::Concerns::ModelExtension
|
|
8
8
|
include Unidom::Product::Concerns::AsSourceProduct
|
|
9
9
|
include Unidom::Product::Concerns::AsTargetProduct
|
|
10
|
+
include ProgneTapera::EnumCode
|
|
10
11
|
|
|
11
12
|
validates :name, presence: true, length: { in: 2..self.columns_hash['name'].limit }
|
|
12
13
|
validates :abbreviation, presence: true, length: { in: 1..self.columns_hash['abbreviation'].limit }
|
|
13
14
|
validates :measurement_unit, presence: true, length: { in: 1..self.columns_hash['measurement_unit'].limit }
|
|
14
15
|
validates :packing_norm, presence: true, length: { in: 1..self.columns_hash['packing_norm'].limit }
|
|
15
16
|
|
|
17
|
+
code :formset, Unidom::Product::Formset
|
|
18
|
+
|
|
16
19
|
end
|
data/config/enum.yml
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: unidom-product
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.
|
|
4
|
+
version: '1.6'
|
|
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-12-
|
|
11
|
+
date: 2016-12-23 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: unidom-common
|
|
@@ -50,6 +50,7 @@ files:
|
|
|
50
50
|
- app/models/unidom/product/concerns/as_target_product_associating.rb
|
|
51
51
|
- app/models/unidom/product/product.rb
|
|
52
52
|
- app/models/unidom/product/product_associating.rb
|
|
53
|
+
- app/types/unidom/product/formset.rb
|
|
53
54
|
- app/types/unidom/product/product_association.rb
|
|
54
55
|
- app/views/layouts/unidom/product/application.html.erb
|
|
55
56
|
- config/enum.yml
|