unidom-standard 1.3.5 → 1.3.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: 51b11fd92fda4c1b24925251aae05d26d27b0406
4
- data.tar.gz: 6622e67c22115bb4c22034af72e5f472f67d6615
3
+ metadata.gz: f747bd52df4025823cb5650614dd49f3b997d1c7
4
+ data.tar.gz: 1ad8efedaa8ee292c6be2a013861bada1b79e359
5
5
  SHA512:
6
- metadata.gz: 57e2a4a65490b7d8990ee53edd33e42814402941937817b3b8559f7c046b7ade9b62de06902e3f5a1bb9ff83d984a06a07bbf4dae292ad7c096dfaf873106f09
7
- data.tar.gz: 84b31568d8cb493a9de1fb2cbea0e991e991a7b253e2b970f9221ccd3a00d4bea2bbb89e53802751df6ddc6c7ce8ee7efd36f817a9a44ee406f5f1a543cc6225
6
+ metadata.gz: b5cfcb39c05026075931a8334fe8be5391aa6022bcdc36d85acab1d7d6ff630e216c8ef515e84edfb6621f4248776c4f4d835c8d391eb10f1d02b1935bc2494a
7
+ data.tar.gz: bb8030080168436661714346a6830bec57b3aa3a04a331c275cb78de2b2af78429418cdab8ef1e4f6f647e4f83282fe095ec89a506aee6389a4b2b569e8ee78e
data/README.md CHANGED
@@ -1,6 +1,8 @@
1
1
  # Unidom Standard 标准领域模型引擎
2
2
 
3
+ [![Documentation](http://img.shields.io/badge/docs-rdoc.info-blue.svg)](http://www.rubydoc.info/gems/unidom-standard/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-standard.svg)](https://badge.fury.io/rb/unidom-standard)
5
7
  [![Dependency Status](https://gemnasium.com/badges/github.com/topbitdu/unidom-standard.svg)](https://gemnasium.com/github.com/topbitdu/unidom-standard)
6
8
 
@@ -57,16 +59,32 @@ include Unidom::Standard::Concerns::AsTargetStandard
57
59
 
58
60
  ### As Source Standard concern
59
61
 
60
- The As Source Standard concern do the following tasks for the includer automatically:
61
- 1. Define the has_many :target_associatings macro as: ``has_many :target_associatings, class_name: 'Unidom::Standard::StandardAssociating', foreign_key: :source_id``
62
- 2. Define the has_many :target_standards macro as: ``has_many :target_standards, through: :target_associatings, source: :target``
63
- 3. Define the #associate! method as: ``associate!(target, due_to: 'REVS', at: Time.now)``
62
+ The As Source Standard concern do the following tasks for the includer automatically:
63
+ 1. Define the has_many :target_associatings macro as: ``has_many :target_associatings, class_name: 'Unidom::Standard::StandardAssociating', foreign_key: :source_id``
64
+ 2. Define the has_many :target_standards macro as: ``has_many :target_standards, through: :target_associatings, source: :target``
65
+ 3. Define the #associate! method as: ``associate!(target, due_to: 'REVS', at: Time.now)``
64
66
  4. Define the #associate? method as: ``associate?(target, due_to: 'REVS', at: Time.now)``
65
67
 
66
68
  ### As Target Standard concern
67
69
 
68
- The As Target Standard concern do the following tasks for the includer automatically:
69
- 1. Define the has_many :source_associatings macro as: ``has_many :source_associatings, class_name: 'Unidom::Standard::StandardAssociating', foreign_key: :target_id``
70
- 2. Define the has_many :source_standards macro as: ``has_many :source_standards, through: :source_associatings, source: :source``
71
- 3. Define the #is_associated! method as: ``is_associated!(source, due_to: 'REVS', at: Time.now)``
70
+ The As Target Standard concern do the following tasks for the includer automatically:
71
+ 1. Define the has_many :source_associatings macro as: ``has_many :source_associatings, class_name: 'Unidom::Standard::StandardAssociating', foreign_key: :target_id``
72
+ 2. Define the has_many :source_standards macro as: ``has_many :source_standards, through: :source_associatings, source: :source``
73
+ 3. Define the #is_associated! method as: ``is_associated!(source, due_to: 'REVS', at: Time.now)``
72
74
  4. Define the #is_associated? method as: ``is_associated?(source, due_to: 'REVS', at: Time.now)``
75
+
76
+
77
+
78
+ ## Disable the Model & Migration
79
+
80
+ If you only need the app components other than models, the migrations should be neglected, and the models should not be loaded.
81
+ ```ruby
82
+ # config/initializers/unidom.rb
83
+ Unidom::Common.configure do |options|
84
+
85
+ options[:neglected_namespaces] = %w{
86
+ Unidom::Standard
87
+ }
88
+
89
+ end
90
+ ```
@@ -1,3 +1,6 @@
1
+ ##
2
+ # Application controller 是模块内所有控制器的基类。
3
+
1
4
  class Unidom::Standard::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::Standard::ApplicationJob < ActiveJob::Base
2
5
  end
@@ -1,3 +1,6 @@
1
+ ##
2
+ # Application mailer 是模块内所有电子邮件发送类的基类。
3
+
1
4
  class Unidom::Standard::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::Standard::ApplicationRecord < ActiveRecord::Base
2
5
  self.abstract_class = true
3
6
  end
@@ -21,4 +21,4 @@ class Unidom::Standard::Standard < Unidom::Standard::ApplicationRecord
21
21
 
22
22
  scope :number_is, ->(number) { where number: number }
23
23
 
24
- end
24
+ end unless Unidom::Common::Neglection.namespace_neglected? 'Unidom::Standard::Standard'
@@ -18,4 +18,4 @@ class Unidom::Standard::StandardAssociating < Unidom::Standard::ApplicationRecor
18
18
  create! source_id: to_id(source), target_id: to_id(with), association_code: due_to, opened_at: at
19
19
  end
20
20
 
21
- end
21
+ end unless Unidom::Common::Neglection.namespace_neglected? 'Unidom::Standard::StandardAssociating'
@@ -1,5 +1,5 @@
1
1
  module Unidom
2
2
  module Standard
3
- VERSION = '1.3.5'.freeze
3
+ VERSION = '1.3.6'.freeze
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: unidom-standard
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.5
4
+ version: 1.3.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: 2017-01-09 00:00:00.000000000 Z
11
+ date: 2017-01-22 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 Standard domain model engine includes Standard and Standard Association models.
29
29
  Unidom (统一领域对象模型)是一系列的领域模型引擎。标准领域模型引擎包括标准和标准关联的模型。