README.md in unidom-visitor-1.1 vs README.md in unidom-visitor-1.2
- old
+ new
@@ -1,9 +1,10 @@
# Unidom Visitor 访问者领域模型引擎
[![License](https://img.shields.io/badge/license-MIT-green.svg)](http://opensource.org/licenses/MIT)
[![Gem Version](https://badge.fury.io/rb/unidom-visitor.svg)](https://badge.fury.io/rb/unidom-visitor)
+[![Dependency Status](https://gemnasium.com/badges/github.com/topbitdu/unidom-visitor.svg)](https://gemnasium.com/github.com/topbitdu/unidom-visitor)
Unidom (UNIfied Domain Object Model) is a series of domain model engines. The Visitor domain model engine includes User, Guest, Administrator, and Password models.
Unidom (统一领域对象模型)是一系列的领域模型引擎。访问者领域模型引擎包括用户、游客、管理员和密码的模型。
@@ -75,14 +76,19 @@
## Inlcude the Concerns
```ruby
include Unidom::Visitor::Concerns::AsVisitor
+include Unidom::Visitor::Concerns::AsCredential
```
### As Visitor concern
The As Visitor concern do the following tasks for the includer automatically:
1. Define the has_many :identificatings macro as: ``has_many :identificatings, class_name: 'Unidom::Visitor::Identificating', as: :visitor``
2. Define the has_many :authenticatings macro as: ``has_many :authenticatings, class_name: 'Unidom::Visitor::Authenticating', as: :visitor``
3. Define the has_many :recognizations macro as: ``has_many :recognizations, class_name: 'Unidom::Visitor::Recognization', as: :visitor``
4. Define the .identified_by scope as: ``scope :identified_by, ->(identity) { joins(:identificatings).merge(Unidom::Visitor::Identificating.identity_is identity) }``
5. Define the .sign_up method as: ``sign_up(identity, password: nil, opened_at: Time.now)``
+
+### As Credential concern
+The As Credential concern do the following tasks for the includer automatically:
+1. Define the has_one :authenticatings macro as: ``has_one :authenticating, class_name: 'Unidom::Visitor::Authenticating', as: :credential``