unidom-visitor 1.1 → 1.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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a04ab37eb00f37113ccd0f040ee2274c0b0f4e07
|
4
|
+
data.tar.gz: 831caea39439818ded903fac9b01df871192aa59
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b2c0e2fdc34366a948e95735e331ebedc92539301027e0e342bf7859844133160c97f6788942bbb5569e9ce0239a50b4ac40e606c2c3d179f541ab28d1fef243
|
7
|
+
data.tar.gz: ad1059566f9d92acd833310e92d3bb20d0b0b311c28ca7e885474962e4e7a273f5fb7e02383af42d40aba9456b35976b2fced22802a3e4a7ef646d0964f36af4
|
data/README.md
CHANGED
@@ -2,6 +2,7 @@
|
|
2
2
|
|
3
3
|
[](http://opensource.org/licenses/MIT)
|
4
4
|
[](https://badge.fury.io/rb/unidom-visitor)
|
5
|
+
[](https://gemnasium.com/github.com/topbitdu/unidom-visitor)
|
5
6
|
|
6
7
|
Unidom (UNIfied Domain Object Model) is a series of domain model engines. The Visitor domain model engine includes User, Guest, Administrator, and Password models.
|
7
8
|
Unidom (统一领域对象模型)是一系列的领域模型引擎。访问者领域模型引擎包括用户、游客、管理员和密码的模型。
|
@@ -77,6 +78,7 @@ Unidom::Visitor::Recognization.cognize! user, as: person
|
|
77
78
|
## Inlcude the Concerns
|
78
79
|
```ruby
|
79
80
|
include Unidom::Visitor::Concerns::AsVisitor
|
81
|
+
include Unidom::Visitor::Concerns::AsCredential
|
80
82
|
```
|
81
83
|
|
82
84
|
### As Visitor concern
|
@@ -86,3 +88,7 @@ The As Visitor concern do the following tasks for the includer automatically:
|
|
86
88
|
3. Define the has_many :recognizations macro as: ``has_many :recognizations, class_name: 'Unidom::Visitor::Recognization', as: :visitor``
|
87
89
|
4. Define the .identified_by scope as: ``scope :identified_by, ->(identity) { joins(:identificatings).merge(Unidom::Visitor::Identificating.identity_is identity) }``
|
88
90
|
5. Define the .sign_up method as: ``sign_up(identity, password: nil, opened_at: Time.now)``
|
91
|
+
|
92
|
+
### As Credential concern
|
93
|
+
The As Credential concern do the following tasks for the includer automatically:
|
94
|
+
1. Define the has_one :authenticatings macro as: ``has_one :authenticating, class_name: 'Unidom::Visitor::Authenticating', as: :credential``
|
@@ -7,7 +7,6 @@ module Unidom::Visitor::Concerns::AsVisitor
|
|
7
7
|
has_many :identificatings, class_name: 'Unidom::Visitor::Identificating', as: :visitor
|
8
8
|
|
9
9
|
has_many :authenticatings, class_name: 'Unidom::Visitor::Authenticating', as: :visitor
|
10
|
-
#has_many :passwords, through: :authenticatings, source: :credential, source_type: 'Unidom::Visitor::Password'
|
11
10
|
|
12
11
|
has_many :recognizations, class_name: 'Unidom::Visitor::Recognization', as: :visitor
|
13
12
|
|
@@ -5,12 +5,11 @@ class Unidom::Visitor::Password < ActiveRecord::Base
|
|
5
5
|
self.table_name = 'unidom_passwords'
|
6
6
|
|
7
7
|
include Unidom::Common::Concerns::ModelExtension
|
8
|
+
include Unidom::Visitor::Concerns::AsCredential
|
8
9
|
|
9
10
|
validates :clear_text, presence: true, length: { in: 6..200 }
|
10
11
|
validates :pepper_content, presence: true, length: { is: columns_hash['pepper_content'].limit }
|
11
12
|
|
12
|
-
has_one :authenticating, class_name: 'Unidom::Visitor::Authenticating', as: :credential
|
13
|
-
|
14
13
|
before_validation :generate_pepper_content
|
15
14
|
|
16
15
|
def generate_pepper_content
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: unidom-visitor
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: '1.
|
4
|
+
version: '1.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: 2016-
|
11
|
+
date: 2016-10-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: unidom-common
|
@@ -41,6 +41,7 @@ files:
|
|
41
41
|
- app/controllers/unidom/visitor/application_controller.rb
|
42
42
|
- app/helpers/unidom/visitor/application_helper.rb
|
43
43
|
- app/models/unidom/visitor/authenticating.rb
|
44
|
+
- app/models/unidom/visitor/concerns/as_credential.rb
|
44
45
|
- app/models/unidom/visitor/concerns/as_visitor.rb
|
45
46
|
- app/models/unidom/visitor/guest.rb
|
46
47
|
- app/models/unidom/visitor/identificating.rb
|