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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 81cb043231dc5c3956a561a22b3374789286db29
4
- data.tar.gz: 233a86eca6fe4b792a100f093670acd764c4b873
3
+ metadata.gz: c9a611dd2b1dc9d5a06f17e5c3a90ed3718ebdf9
4
+ data.tar.gz: 1ccab5908ed5b212604751a6d2c71d92780eff35
5
5
  SHA512:
6
- metadata.gz: ac4e1b8e4b16387e074f6196ba162607bb19a6d1a9817074e421e85a88bd9bdf3cd666ebb157e613b68d75945d8235988c78cc75766d0e6edba9598b7269ed6e
7
- data.tar.gz: 5078529aa0f3c1708b580b01d1a0ab3b010958275cc7cd91ddb6ac583ee9d41bf0bf17e0aa8a8a74a95030fdd5ecd18a0130da5fafad9ec4efea8f913e892596
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
+ ```
@@ -1,3 +1,6 @@
1
+ ##
2
+ # Application controller 是模块内所有控制器的基类。
3
+
1
4
  class Unidom::Product::ApplicationController < ActionController::Base
2
5
  protect_from_forgery with: :exception
3
6
  end
@@ -1,2 +1,5 @@
1
+ ##
2
+ # Application job 是模块内所有异步任务的基类。
3
+
1
4
  class Unidom::Product::ApplicationJob < ActiveJob::Base
2
5
  end
@@ -1,3 +1,6 @@
1
+ ##
2
+ # Application mailer 是模块内所有电子邮件发送类的基类。
3
+
1
4
  class Unidom::Product::ApplicationMailer < ActionMailer::Base
2
5
  default from: 'from@example.com'
3
6
  layout 'mailer'
@@ -1,3 +1,6 @@
1
+ ##
2
+ # Application record 是模块内所有模型的抽象基类。
3
+
1
4
  class Unidom::Product::ApplicationRecord < ActiveRecord::Base
2
5
  self.abstract_class = true
3
6
  end
@@ -17,4 +17,4 @@ class Unidom::Product::Product < Unidom::Product::ApplicationRecord
17
17
 
18
18
  code :formset, Unidom::Product::Formset
19
19
 
20
- end
20
+ end unless Unidom::Common::Neglection.namespace_neglected? 'Unidom::Product::Product'
@@ -44,4 +44,4 @@ class Unidom::Product::ProductAssociating < Unidom::Product::ApplicationRecord
44
44
 
45
45
  end
46
46
 
47
- end
47
+ end unless Unidom::Common::Neglection.namespace_neglected? 'Unidom::Product::ProductAssociating'
@@ -1,5 +1,5 @@
1
1
  module Unidom
2
2
  module Product
3
- VERSION = '1.6.1'.freeze
3
+ VERSION = '1.6.2'.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.6.1
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-09 00:00:00.000000000 Z
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.8'
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.8'
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
  (统一领域对象模型)是一系列的领域模型引擎。产品领域模型引擎包括产品及其相关的模型。