unidom-dictionary 0.2.1 → 0.2.2

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ddd7daff831d59c4d4c946fed082fbd8256bfc9d
4
- data.tar.gz: a773f5cc226d55b6742fb482a89f93fce79bd2c1
3
+ metadata.gz: 78e95e4693a58be14dc8bea5e10037440e60b892
4
+ data.tar.gz: 3c4b6151219850d5df4a2c6970ceaa0bf8f14d67
5
5
  SHA512:
6
- metadata.gz: b9faf2779ab7596f32960ae1fa1c5a6e065cde76a6871451d886037b2e151a34b96960ad60490e4d554a0f002ccbff5825704bf88347caabf5a542a9aa8fd99d
7
- data.tar.gz: 6ee5a831cf9f230d3eb34c91d021d0f19a3fc75f1055747c3d2c3435ffa4409933f5b41fb129a422fa7e93c148c234eda49fa67dd32c9c8a8823ab9b2f15cdc4
6
+ metadata.gz: 0fb5cf4defcd72fb4e030bb8444507e20ca96c50e03eb95e5983dbda3fce5ec646269ec7e01f938b3673a82c3370fe377c107da792965f8cd71bdce1a97b6459
7
+ data.tar.gz: d82bd5c408dd189cb52ddafb08935819d3c6c5dab992301c06e49d0601f840febca18ceae45bc717cd50a525d0fa75152afe5149a561a2b82cb62086ccbad3ea
data/README.md CHANGED
@@ -1,6 +1,8 @@
1
1
  # Unidom Dictionary 字典领域模型引擎
2
2
 
3
+ [![Documentation](http://img.shields.io/badge/docs-rdoc.info-blue.svg)](http://www.rubydoc.info/gems/unidom-dictionary/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-dictionary.svg)](https://badge.fury.io/rb/unidom-dictionary)
5
7
  [![Dependency Status](https://gemnasium.com/badges/github.com/topbitdu/unidom-dictionary.svg)](https://gemnasium.com/github.com/topbitdu/unidom-dictionary)
6
8
 
@@ -45,5 +47,21 @@ social = Unidom::Dictionary::DictionaryItem.create! attributes.merge({
45
47
  intellectual = Unidom::Dictionary::DictionaryItem.create! attributes.merge({ code: 'INTL', value: 'Intellectual' })
46
48
  spiritual = Unidom::Dictionary::DictionaryItem.create! attributes.merge({ code: 'SPRT', value: 'Spiritual' })
47
49
  emotional = Unidom::Dictionary::DictionaryItem.create! attributes.merge({ code: 'EMTN', value: 'Emotional' })
48
- # The #code attribtue could be nil.
50
+ # The #code attribtue could be nil.
51
+ ```
52
+
53
+
54
+
55
+ ## Disable the Model & Migration
56
+
57
+ If you only need the app components other than models, the migrations should be neglected, and the models should not be loaded.
58
+ ```ruby
59
+ # config/initializers/unidom.rb
60
+ Unidom::Common.configure do |options|
61
+
62
+ options[:neglected_namespaces] = %w{
63
+ Unidom::Dictionary
64
+ }
65
+
66
+ end
49
67
  ```
@@ -1,3 +1,6 @@
1
+ ##
2
+ # Application controller 是模块内所有控制器的基类。
3
+
1
4
  class Unidom::Dictionary::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::Dictionary::ApplicationJob < ActiveJob::Base
2
5
  end
@@ -1,3 +1,6 @@
1
+ ##
2
+ # Application mailer 是模块内所有电子邮件发送类的基类。
3
+
1
4
  class Unidom::Dictionary::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::Dictionary::ApplicationRecord < ActiveRecord::Base
2
5
  self.abstract_class = true
3
6
  end
@@ -10,4 +10,4 @@ class Unidom::Dictionary::DictionaryItem < Unidom::Dictionary::ApplicationRecord
10
10
  validates :code, allow_blank: true, length: { in: 1..self.columns_hash['code'].limit }
11
11
  validates :value, presence: true, length: { in: 2..self.columns_hash['value'].limit }
12
12
 
13
- end
13
+ end unless Unidom::Common::Neglection.namespace_neglected? 'Unidom::Dictionary::DictionaryItem'
@@ -1,5 +1,5 @@
1
1
  module Unidom
2
2
  module Dictionary
3
- VERSION = '0.2.1'.freeze
3
+ VERSION = '0.2.2'.freeze
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: unidom-dictionary
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.2.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 Dictionary domain model engine includes the Dictionary Item model and its relative
29
29
  models. Unidom (统一领域对象模型)是一系列的领域模型引擎。字典领域模型引擎包括字典项和与其相关的模型。