README.md in unidom-contact-1.3.4 vs README.md in unidom-contact-1.3.5
- old
+ new
@@ -1,8 +1,10 @@
# Unidom Contact 联系方式领域模型引擎
+[![Documentation](http://img.shields.io/badge/docs-rdoc.info-blue.svg)](http://www.rubydoc.info/gems/unidom-contact/frames)
[![License](https://img.shields.io/badge/license-MIT-green.svg)](http://opensource.org/licenses/MIT)
+
[![Gem Version](https://badge.fury.io/rb/unidom-contact.svg)](https://badge.fury.io/rb/unidom-contact)
[![Dependency Status](https://gemnasium.com/badges/github.com/topbitdu/unidom-contact.svg)](https://gemnasium.com/github.com/topbitdu/unidom-contact)
Unidom (UNIfied Domain Object Model) is a series of domain model engines. The Contact domain model engine includes Contact Subscription and Email Address models.
Unidom (统一领域对象模型)是一系列的领域模型引擎。联系方式领域模型引擎包括联系方式订阅和电子邮箱地址的模型。
@@ -65,21 +67,45 @@
```
### As Contact concern
The As Contact concern do the following tasks for the includer automatically:
-1. Define the has_many :contact_subscriptions macro as: ``has_many :contact_subscriptions, class_name: 'Unidom::Contact::ContactSubscription', as: :contact``
-2. Define the #is_subscribed_as_contact! method as: ``is_subscribed_as_contact!(by: nil, at: Time.now, name: by.try(:name), primary: true)``
+
+1. Define the has_many :contact_subscriptions macro as: ``has_many :contact_subscriptions, class_name: 'Unidom::Contact::ContactSubscription', as: :contact``
+
+2. Define the #is_subscribed_as_contact! method as: ``is_subscribed_as_contact!(by: nil, at: Time.now, name: by.try(:name), primary: true)``
+
3. Define the #is_subscribed_as_contact? method as: ``is_subscribed_as_contact?(by: nil, at: Time.now, primary: true)``
### As Subscriber concern
The As Subscriber concern do the following tasks for the includer automatically:
-1. Define the has_many :contact_subscriptions macro as: ``has_many :contact_subscriptions, class_name: 'Unidom::Contact::ContactSubscription', as: :subscriber``
-2. Define the #subscribe_contact! method as: ``subscribe_contact!(contact, at: Time.now, name: nil, primary: true)``
+
+1. Define the has_many :contact_subscriptions macro as: ``has_many :contact_subscriptions, class_name: 'Unidom::Contact::ContactSubscription', as: :subscriber``
+
+2. Define the #subscribe_contact! method as: ``subscribe_contact!(contact, at: Time.now, name: nil, primary: true)``
+
3. Define the #subscribe_contact? method as: ``subscribe_contact?(contact, at: Time.now, primary: true)``
### As Email Address Subscriber concern
The As Email Address Subscriber concern do the following tasks for the includer automatically:
-1. Include the As Subscriber concern
+
+1. Include the As Subscriber concern
+
2. Define the has_many :email_addresses macro as: ``has_many :email_addresses, through: :contact_subscriptions, source: :contact, source_type: 'Unidom::Contact::EmailAddress'``
+
+
+
+## Disable the Model & Migration
+
+If you only need the app components other than models, the migrations should be neglected, and the models should not be loaded.
+```ruby
+# config/initializers/unidom.rb
+Unidom::Common.configure do |options|
+
+ options[:neglected_namespaces] = %w{
+ Unidom::Contact
+ }
+
+end
+```