unidom-visitor 1.2 → 1.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +5 -0
- data/app/models/unidom/visitor/concerns/as_identity.rb +14 -0
- data/app/models/unidom/visitor/user.rb +0 -9
- data/lib/unidom/visitor/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b8d773962937ec0d9982d0d06a3a60a20d60f564
|
4
|
+
data.tar.gz: 9962fce0d00f6eb63f8d66b85806a8c35e3adcf2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1ceb13ad71b2014f99b451c4124656bf241f71f2f2a2d779f61804fef5e4fe54db40db83002dd5fb1dd0c5acba8be9069baa2692940498df65fea7e43f5ce0c8
|
7
|
+
data.tar.gz: 44a9af0960256f06835c34439e1f53983a163ee3c8bf0f46d2948c61a74f60f5289cba5224664fafeab8ee23e9ba6210c00511eca0fafa94994895bb49e79859
|
data/README.md
CHANGED
@@ -78,6 +78,7 @@ Unidom::Visitor::Recognization.cognize! user, as: person
|
|
78
78
|
## Inlcude the Concerns
|
79
79
|
```ruby
|
80
80
|
include Unidom::Visitor::Concerns::AsVisitor
|
81
|
+
include Unidom::Visitor::Concerns::AsIdentity
|
81
82
|
include Unidom::Visitor::Concerns::AsCredential
|
82
83
|
```
|
83
84
|
|
@@ -89,6 +90,10 @@ The As Visitor concern do the following tasks for the includer automatically:
|
|
89
90
|
4. Define the .identified_by scope as: ``scope :identified_by, ->(identity) { joins(:identificatings).merge(Unidom::Visitor::Identificating.identity_is identity) }``
|
90
91
|
5. Define the .sign_up method as: ``sign_up(identity, password: nil, opened_at: Time.now)``
|
91
92
|
|
93
|
+
### As Identity concern
|
94
|
+
The As Identity concern do the following tasks for the includer automatically:
|
95
|
+
1. Define the has_many :identificatings macro as: ``has_many :identificatings, class_name: 'Unidom::Visitor::Identificating', as: :identity``
|
96
|
+
|
92
97
|
### As Credential concern
|
93
98
|
The As Credential concern do the following tasks for the includer automatically:
|
94
99
|
1. Define the has_one :authenticatings macro as: ``has_one :authenticating, class_name: 'Unidom::Visitor::Authenticating', as: :credential``
|
@@ -4,15 +4,6 @@ class Unidom::Visitor::User < ActiveRecord::Base
|
|
4
4
|
|
5
5
|
self.table_name = 'unidom_users'
|
6
6
|
|
7
|
-
#has_many :identificatings, class_name: 'Unidom::Visitor::Identificating', as: :visitor
|
8
|
-
|
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
|
-
|
12
|
-
#has_many :recognizations, class_name: 'Unidom::Visitor::Recognization', as: :visitor
|
13
|
-
|
14
|
-
#scope :identified_by, ->(identity) { joins(:identificatings).merge(Unidom::Visitor::Identificating.identity_is identity) }
|
15
|
-
|
16
7
|
include Unidom::Common::Concerns::ModelExtension
|
17
8
|
include Unidom::Visitor::Concerns::AsVisitor
|
18
9
|
|
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.3'
|
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-10-
|
11
|
+
date: 2016-10-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: unidom-common
|
@@ -42,6 +42,7 @@ files:
|
|
42
42
|
- app/helpers/unidom/visitor/application_helper.rb
|
43
43
|
- app/models/unidom/visitor/authenticating.rb
|
44
44
|
- app/models/unidom/visitor/concerns/as_credential.rb
|
45
|
+
- app/models/unidom/visitor/concerns/as_identity.rb
|
45
46
|
- app/models/unidom/visitor/concerns/as_visitor.rb
|
46
47
|
- app/models/unidom/visitor/guest.rb
|
47
48
|
- app/models/unidom/visitor/identificating.rb
|