unidom-visitor 0.1 → 0.1.1
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 +4 -4
- data/README.md +6 -5
- data/app/models/unidom/visitor/authenticating.rb +1 -1
- data/app/models/unidom/visitor/guest.rb +1 -1
- data/app/models/unidom/visitor/identificating.rb +1 -1
- data/app/models/unidom/visitor/password.rb +1 -1
- data/app/models/unidom/visitor/recognization.rb +2 -2
- data/app/models/unidom/visitor/user.rb +1 -1
- data/lib/unidom/visitor/version.rb +1 -1
- metadata +5 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d59a0fb39173914d2333b53ff96c8de56db42ef3
|
4
|
+
data.tar.gz: 454f6abc996528d7e194fc89a2bfbc4f243cc403
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e3a1656114518bca1f46b4b1cd124e4ef792242f47a9b7f364ec6e1a56af0e65d7b9f6849a2082eb194108926cc50d55eb15e21ae62e6f63c747b44678779f81
|
7
|
+
data.tar.gz: 7f16820fbcf02c695ec5a325f2d4765a2fedfd19efb0cde01701aa5455b8b9cb7ea77263b633d2a25e40fb257dd536dce215c1844e980786fa7ef7c3cb201fa6
|
data/README.md
CHANGED
@@ -1,23 +1,24 @@
|
|
1
|
-
# Unidom Visitor
|
1
|
+
# Unidom Visitor 访问者领域模型引擎
|
2
2
|
|
3
3
|
[](http://opensource.org/licenses/MIT)
|
4
|
+
[](https://badge.fury.io/rb/unidom-visitor)
|
4
5
|
|
5
6
|
Unidom (UNIfied Domain Object Model) is a series of domain model engines. The Visitor domain model engine includes User, Guest, Administrator, and Password models.
|
6
7
|
Unidom (统一领域对象模型)是一系列的领域模型引擎。访问者领域模型引擎包括用户、游客、管理员和密码的模型。
|
7
8
|
|
8
|
-
## Usage in Gemfile
|
9
|
+
## Usage in Gemfile
|
9
10
|
```ruby
|
10
11
|
gem 'unidom-visitor'
|
11
12
|
```
|
12
13
|
|
13
|
-
## Run the Database Migration
|
14
|
+
## Run the Database Migration
|
14
15
|
```shell
|
15
16
|
rake db:migrate
|
16
17
|
```
|
17
18
|
|
18
|
-
## Call the Model
|
19
|
+
## Call the Model
|
19
20
|
```ruby
|
20
|
-
Unidom::Visitor::User.
|
21
|
+
Unidom::Visitor::User.sign_up mobile_phone_number_entity, 'password'
|
21
22
|
Unidom::Visitor::Guest.valid_at.alive.first
|
22
23
|
Unidom::Visitor::User.valid_at.alive.first.passwords.valid_at.alive.first.merge(Unidom::Visitor::Authenticating.valid_at.alive).first
|
23
24
|
```
|
@@ -12,7 +12,7 @@ class Unidom::Visitor::Authenticating < ActiveRecord::Base
|
|
12
12
|
scope :visitor_is, ->(visitor) { where visitor: visitor }
|
13
13
|
scope :credential_is, ->(credential) { where credential: credential }
|
14
14
|
|
15
|
-
include
|
15
|
+
include Unidom::Common::Concerns::ModelExtension
|
16
16
|
|
17
17
|
def self.authenticate(visitor, credential)
|
18
18
|
self.create! visitor: visitor, credential: credential, opened_at: Time.now
|
@@ -8,6 +8,6 @@ class Unidom::Visitor::Guest < ActiveRecord::Base
|
|
8
8
|
|
9
9
|
scope :platform_specific_identification_is, ->(platform_specific_identification) { where platform_specific_identification: platform_specific_identification }
|
10
10
|
|
11
|
-
include
|
11
|
+
include Unidom::Common::Concerns::ModelExtension
|
12
12
|
|
13
13
|
end
|
@@ -10,7 +10,7 @@ class Unidom::Visitor::Identificating < ActiveRecord::Base
|
|
10
10
|
scope :identity_is, ->(identity) { where identity: identity }
|
11
11
|
scope :visitor_is, ->(visitor) { where visitor: visitor }
|
12
12
|
|
13
|
-
include
|
13
|
+
include Unidom::Common::Concerns::ModelExtension
|
14
14
|
|
15
15
|
def self.find_identity(visitor)
|
16
16
|
visitor_is(visitor).first.try :identity
|
@@ -6,7 +6,7 @@ class Unidom::Visitor::Password < ActiveRecord::Base
|
|
6
6
|
|
7
7
|
has_one :authenticating, class_name: 'Unidom::Visitor::Authenticating', as: :credential
|
8
8
|
|
9
|
-
include
|
9
|
+
include Unidom::Common::Concerns::ModelExtension
|
10
10
|
|
11
11
|
def generate_pepper_content
|
12
12
|
self.pepper_content = self.pepper_content||::SecureRandom.hex(self.class.columns_hash['pepper_content'].limit/2)
|
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
class Unidom::Visitor::Recognization < ActiveRecord::Base
|
4
4
|
|
5
|
-
self.
|
5
|
+
self.table_name = 'unidom_recognizations'
|
6
6
|
|
7
7
|
belongs_to :visitor, polymorphic: true
|
8
8
|
belongs_to :party, polymorphic: true
|
@@ -10,7 +10,7 @@ class Unidom::Visitor::Recognization < ActiveRecord::Base
|
|
10
10
|
scope :visitor_is, ->(visitor) { where visitor: visitor }
|
11
11
|
scope :party_is, ->(party) { where party: party }
|
12
12
|
|
13
|
-
include
|
13
|
+
include Unidom::Common::Concerns::ModelExtension
|
14
14
|
|
15
15
|
def self.cognize(visitor, party)
|
16
16
|
raise 'Visitor can not be null.' if visitor.blank?
|
@@ -13,7 +13,7 @@ class Unidom::Visitor::User < ActiveRecord::Base
|
|
13
13
|
|
14
14
|
scope :identified_by, ->(identity) { joins(:identificatings).merge(::Unidom::Visitor::Identificating.identity_is identity) }
|
15
15
|
|
16
|
-
include
|
16
|
+
include Unidom::Common::Concerns::ModelExtension
|
17
17
|
|
18
18
|
def self.sign_up(identity, password)
|
19
19
|
|
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:
|
4
|
+
version: 0.1.1
|
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-03-18 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: '0.
|
19
|
+
version: '0.5'
|
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: '0.
|
26
|
+
version: '0.5'
|
27
27
|
description: Unidom (UNIfied Domain Object Model) is a series of domain model engines.
|
28
28
|
The Visitor domain model engine includes User, Guest, Administrator, and Password
|
29
29
|
models. Unidom (统一领域对象模型)是一系列的领域模型引擎。访问者领域模型引擎包括用户、游客、管理员和密码的模型。
|
@@ -81,6 +81,5 @@ rubyforge_project:
|
|
81
81
|
rubygems_version: 2.4.5.1
|
82
82
|
signing_key:
|
83
83
|
specification_version: 4
|
84
|
-
summary:
|
85
|
-
Password models.
|
84
|
+
summary: Unidom Visitor Domain Model Engine 访问者领域模型引擎
|
86
85
|
test_files: []
|