unidom-visitor 1.13.4 → 1.13.5
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1548e1bbdb03bf173876665278c0f89b3b780212
|
4
|
+
data.tar.gz: aa7195117c0aa319e0a7e199de9b40388c1b7845
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f6ac8dbce79296442cb7f32308e994059bbd654c14cbe9c294cbb9ae64b8663a2f2b39ea6b7da0808f946d9e30d12d4b2a5b43f90d218d60ce82aee43094ae09
|
7
|
+
data.tar.gz: 6549bc235bb223f97f522acd955b167f4b802f2f96a6b18ee92d65d58bae0de8b6f8a27dfdef466bfc404077b5ba5c63dcd7c10918ff79f0b3854dab3a7fa1b0
|
@@ -13,6 +13,10 @@ class Unidom::Visitor::Identificating < Unidom::Visitor::ApplicationRecord
|
|
13
13
|
scope :identity_is, ->(identity) { where identity: identity }
|
14
14
|
scope :visitor_is, ->(visitor) { where visitor: visitor }
|
15
15
|
|
16
|
+
##
|
17
|
+
# 根据访问者 visitor ,找到其对应的登录身份标示 identity (如手机号码或自定义用户名)。如:
|
18
|
+
# mobile_phone_number = Unidom::Visitor::Identificating.find_identity user
|
19
|
+
# puts mobile_phone_number.phone_number
|
16
20
|
def self.find_identity(visitor)
|
17
21
|
visitor_is(visitor).first.try :identity
|
18
22
|
end
|
@@ -13,26 +13,10 @@ describe Unidom::Visitor::Guest, type: :model do
|
|
13
13
|
platform_specific_identification: '123456789012'
|
14
14
|
}
|
15
15
|
|
16
|
-
platform_specific_identification_max_length = described_class.columns_hash['platform_specific_identification'].limit
|
17
|
-
|
18
16
|
it_behaves_like 'Unidom::Common::Concerns::ModelExtension', model_attributes
|
19
17
|
|
20
|
-
it_behaves_like 'validates', model_attributes, :platform_specific_identification,
|
21
|
-
|
22
|
-
{ platform_specific_identification: nil } => 2,
|
23
|
-
{ platform_specific_identification: '' } => 2,
|
24
|
-
{ platform_specific_identification: '1' } => 1,
|
25
|
-
{ platform_specific_identification: 'A' } => 1,
|
26
|
-
{ platform_specific_identification: '11' } => 0,
|
27
|
-
{ platform_specific_identification: 'AA' } => 0,
|
28
|
-
{ platform_specific_identification: '111' } => 0,
|
29
|
-
{ platform_specific_identification: 'AAA' } => 0,
|
30
|
-
{ platform_specific_identification: '1'*(platform_specific_identification_max_length-1) } => 0,
|
31
|
-
{ platform_specific_identification: 'A'*(platform_specific_identification_max_length-1) } => 0,
|
32
|
-
{ platform_specific_identification: '1'*platform_specific_identification_max_length } => 0,
|
33
|
-
{ platform_specific_identification: 'A'*platform_specific_identification_max_length } => 0,
|
34
|
-
{ platform_specific_identification: '1'*(platform_specific_identification_max_length+1) } => 1,
|
35
|
-
{ platform_specific_identification: 'A'*(platform_specific_identification_max_length+1) } => 1
|
18
|
+
it_behaves_like 'validates text', model_attributes, :platform_specific_identification,
|
19
|
+
length: 2..described_class.columns_hash['platform_specific_identification'].limit
|
36
20
|
|
37
21
|
new_platform_specific_identification = 'ABCDEFGHIJKLMNOP'
|
38
22
|
it_behaves_like 'scope', :platform_specific_identification_is, [
|
@@ -12,28 +12,12 @@ describe Unidom::Visitor::Password, type: :model do
|
|
12
12
|
clear_text: 'password'
|
13
13
|
}
|
14
14
|
|
15
|
-
clear_text_max_length = 200
|
16
|
-
pepper_content_max_length = described_class.columns_hash['pepper_content'].limit
|
17
|
-
|
18
15
|
it_behaves_like 'Unidom::Common::Concerns::ModelExtension', model_attributes
|
19
16
|
|
20
|
-
it_behaves_like 'validates', model_attributes, :clear_text,
|
21
|
-
|
22
|
-
{ clear_text: nil } => 2,
|
23
|
-
{ clear_text: '' } => 2,
|
24
|
-
{ clear_text: '1'*5 } => 1,
|
25
|
-
{ clear_text: 'A'*5 } => 1,
|
26
|
-
{ clear_text: '1'*6 } => 0,
|
27
|
-
{ clear_text: 'A'*6 } => 0,
|
28
|
-
{ clear_text: '1'*7 } => 0,
|
29
|
-
{ clear_text: 'A'*7 } => 0,
|
30
|
-
{ clear_text: '1'*(clear_text_max_length-1) } => 0,
|
31
|
-
{ clear_text: 'A'*(clear_text_max_length-1) } => 0,
|
32
|
-
{ clear_text: '1'*clear_text_max_length } => 0,
|
33
|
-
{ clear_text: 'A'*clear_text_max_length } => 0,
|
34
|
-
{ clear_text: '1'*(clear_text_max_length+1) } => 1,
|
35
|
-
{ clear_text: 'A'*(clear_text_max_length+1) } => 1
|
17
|
+
it_behaves_like 'validates text', model_attributes, :clear_text,
|
18
|
+
length: 6..200
|
36
19
|
|
20
|
+
pepper_content_max_length = described_class.columns_hash['pepper_content'].limit
|
37
21
|
it_behaves_like 'validates', model_attributes, :pepper_content,
|
38
22
|
{ } => 0,
|
39
23
|
{ pepper_content: nil } => 0,
|
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.13.
|
4
|
+
version: 1.13.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Topbit Du
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-03-
|
11
|
+
date: 2017-03-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: unidom-common
|