unidom-product 1.5.1 → 1.6

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 68d772f15325bea346ee2a4246907eb31dfadae9
4
- data.tar.gz: 91031739ddce02e596e006f2922f1232ffc2b18a
3
+ metadata.gz: 907a1161756dc77c80828a924bf38c303c5e18dd
4
+ data.tar.gz: 20d56aa708474959d89263c746314a04c67fced8
5
5
  SHA512:
6
- metadata.gz: 5b45b7807682bc7bd3efcf8b424a5738ccac8ab97fd881faa809ee3fab0c7164eb7793f5150f911f2fb93c11c879a49f6ad8a6cd7829f9a578af2449e8dc5b5a
7
- data.tar.gz: ca6b7f965382088d61c47bb3288e134833981522f29534294c7ca30e4ea8b12fd81bb7f329079322b240e80ae9dd481e9f18c0b1ba81e2c7cccec441bd709da5
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
@@ -0,0 +1,7 @@
1
+ class Unidom::Product::Formset < ActiveRecord::Type::Value
2
+
3
+ include ProgneTapera::EnumConfig
4
+
5
+ enum :unidom_formset
6
+
7
+ end
data/config/enum.yml CHANGED
@@ -9,3 +9,11 @@ enum:
9
9
  code: 'OBSL'
10
10
  substitute:
11
11
  code: 'SBST'
12
+
13
+ unidom_formset:
14
+ ware:
15
+ code: 'WARE'
16
+ service:
17
+ code: 'SRVC'
18
+ portfolio:
19
+ code: 'PTFL'
@@ -6,3 +6,8 @@
6
6
  incompatibility: 不兼容
7
7
  obsolescence: 废弃
8
8
  substitute: 替代
9
+
10
+ unidom_formset:
11
+ ware: 货物
12
+ service: 服务
13
+ portfolio: 组合
@@ -1,5 +1,5 @@
1
1
  module Unidom
2
2
  module Product
3
- VERSION = '1.5.1'.freeze
3
+ VERSION = '1.6'.freeze
4
4
  end
5
5
  end
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.5.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-09 00:00:00.000000000 Z
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