unidom-product 1.6.1 → 1.6.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +26 -8
- data/app/controllers/unidom/product/application_controller.rb +3 -0
- data/app/jobs/unidom/product/application_job.rb +3 -0
- data/app/mailers/unidom/product/application_mailer.rb +3 -0
- data/app/models/unidom/product/application_record.rb +3 -0
- data/app/models/unidom/product/product.rb +1 -1
- data/app/models/unidom/product/product_associating.rb +1 -1
- data/lib/unidom/product/version.rb +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c9a611dd2b1dc9d5a06f17e5c3a90ed3718ebdf9
|
4
|
+
data.tar.gz: 1ccab5908ed5b212604751a6d2c71d92780eff35
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4be60b299eec65cca889cc5da218129cd656d58808d7bbe8012759b958d7c2e93ed2b60499df0b96f1255a0f2b34f670a596e908a71a3beaafd61c267d6896e8
|
7
|
+
data.tar.gz: f44d615de6622d883f29deccdbe5164dfc65bf98d1347246054eac843650b32768937eec8797b9930362bd9239a6ce27a02d0efb45302570dfe8a400e6b53258
|
data/README.md
CHANGED
@@ -1,6 +1,8 @@
|
|
1
1
|
# Unidom Product 产品领域模型引擎
|
2
2
|
|
3
|
+
[![Documentation](http://img.shields.io/badge/docs-rdoc.info-blue.svg)](http://www.rubydoc.info/gems/unidom-product/frames)
|
3
4
|
[![License](https://img.shields.io/badge/license-MIT-green.svg)](http://opensource.org/licenses/MIT)
|
5
|
+
|
4
6
|
[![Gem Version](https://badge.fury.io/rb/unidom-product.svg)](https://badge.fury.io/rb/unidom-product)
|
5
7
|
[![Dependency Status](https://gemnasium.com/badges/github.com/topbitdu/unidom-product.svg)](https://gemnasium.com/github.com/topbitdu/unidom-product)
|
6
8
|
|
@@ -66,18 +68,18 @@ include Unidom::Product::Concerns::AsTargetProduct
|
|
66
68
|
|
67
69
|
### As Source Product concern
|
68
70
|
|
69
|
-
The As Source Product concern do the following tasks for the includer automatically:
|
70
|
-
1. Define the has_many :target_product_associatings macro as: ``has_many :target_product_associatings, class_name: 'Unidom::Product::ProductAssociating', foreign_key: :source_id``
|
71
|
-
2. Define the has_many :target_products macro as: ``has_many :target_products, through: :target_product_associatings, source: :target``
|
72
|
-
3. Define the #associate! method as: ``associate!(target, due_to: nil, at: Time.now, ordinal: 1)``
|
71
|
+
The As Source Product concern do the following tasks for the includer automatically:
|
72
|
+
1. Define the has_many :target_product_associatings macro as: ``has_many :target_product_associatings, class_name: 'Unidom::Product::ProductAssociating', foreign_key: :source_id``
|
73
|
+
2. Define the has_many :target_products macro as: ``has_many :target_products, through: :target_product_associatings, source: :target``
|
74
|
+
3. Define the #associate! method as: ``associate!(target, due_to: nil, at: Time.now, ordinal: 1)``
|
73
75
|
4. Define the #associate? method as: ``associate?(target, due_to: nil, at: Time.now)``
|
74
76
|
|
75
77
|
### As Target Product concern
|
76
78
|
|
77
|
-
The As Target Product concern do the following tasks for the includer automatically:
|
78
|
-
1. Define the has_many :source_product_associatings macro as: ``has_many :source_product_associatings, class_name: 'Unidom::Product::ProductAssociating', foreign_key: :target_id``
|
79
|
-
2. Define the has_many :source_products macro as: ``has_many :source_products, through: :source_product_associatings, source: :source``
|
80
|
-
3. Define the #is_associated! method as: ``is_associated!(source, due_to: nil, at: Time.now, ordinal: 1)``
|
79
|
+
The As Target Product concern do the following tasks for the includer automatically:
|
80
|
+
1. Define the has_many :source_product_associatings macro as: ``has_many :source_product_associatings, class_name: 'Unidom::Product::ProductAssociating', foreign_key: :target_id``
|
81
|
+
2. Define the has_many :source_products macro as: ``has_many :source_products, through: :source_product_associatings, source: :source``
|
82
|
+
3. Define the #is_associated! method as: ``is_associated!(source, due_to: nil, at: Time.now, ordinal: 1)``
|
81
83
|
4. Define the #is_associated? method as: ``is_associated?(source, due_to: nil, at: Time.now)``
|
82
84
|
|
83
85
|
|
@@ -100,3 +102,19 @@ Unidom::Product::Formset::ware # 货物
|
|
100
102
|
Unidom::Product::Formset::service # 服务
|
101
103
|
Unidom::Product::Formset::portfolio # 组合
|
102
104
|
```
|
105
|
+
|
106
|
+
|
107
|
+
|
108
|
+
## Disable the Model & Migration
|
109
|
+
|
110
|
+
If you only need the app components other than models, the migrations should be neglected, and the models should not be loaded.
|
111
|
+
```ruby
|
112
|
+
# config/initializers/unidom.rb
|
113
|
+
Unidom::Common.configure do |options|
|
114
|
+
|
115
|
+
options[:neglected_namespaces] = %w{
|
116
|
+
Unidom::Product
|
117
|
+
}
|
118
|
+
|
119
|
+
end
|
120
|
+
```
|
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.6.
|
4
|
+
version: 1.6.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Topbit Du
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-01-
|
11
|
+
date: 2017-01-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: unidom-common
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '1.
|
19
|
+
version: '1.9'
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: '1.
|
26
|
+
version: '1.9'
|
27
27
|
description: Unidom (UNIfied Domain Object Model) is a series of domain model engines.
|
28
28
|
The Product domain model engine includes Product and its relative models. Unidom
|
29
29
|
(统一领域对象模型)是一系列的领域模型引擎。产品领域模型引擎包括产品及其相关的模型。
|