validates_identity 0.5.0 → 0.5.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +12 -0
- data/Gemfile.lock +1 -1
- data/lib/shoulda/matchers/active_model/require_a_valid_identity_matcher.rb +6 -6
- data/lib/validates_identity/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9085025f8d95534d921da509e3c7ee686ff162982ada75797f49dd707054f45d
|
4
|
+
data.tar.gz: d13993171531b0d63a2f283594979f5ca28769b2b3686574d13ea345a1dafcff
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 739b863e02256bae0369e1b67a434a9f5210b91762ebb7bcfca8ffe01580b100ce413aaea85b97f35161dff7974c2a08801e1b6d935dd62f76182c620b7faa31
|
7
|
+
data.tar.gz: dc0be85c6cce231a380642e181eae13cc8d62268a47f4779e1e3da6d7540b3d7159dd4a15b50162c55d25c17e61484d568b07cda5fb8a9bdcda180a4d1234292
|
data/CHANGELOG.md
CHANGED
data/Gemfile.lock
CHANGED
@@ -5,15 +5,15 @@ require 'shoulda-matchers'
|
|
5
5
|
module Shoulda
|
6
6
|
module Matchers
|
7
7
|
module ActiveModel
|
8
|
-
def require_a_valid_identity(identity = :identity, identity_type = :identity_type)
|
9
|
-
RequireAValidIdentityMatcher.new(identity, identity_type)
|
8
|
+
def require_a_valid_identity(identity = :identity, identity_type = :identity_type, only: :both)
|
9
|
+
RequireAValidIdentityMatcher.new(identity, identity_type, only)
|
10
10
|
end
|
11
11
|
|
12
12
|
class RequireAValidIdentityMatcher < ValidationMatcher
|
13
|
-
def initialize(identity, identity_type)
|
13
|
+
def initialize(identity, identity_type, type)
|
14
14
|
super(identity)
|
15
15
|
@identity_type = identity_type
|
16
|
-
@type =
|
16
|
+
@type = type
|
17
17
|
end
|
18
18
|
|
19
19
|
def description
|
@@ -68,8 +68,8 @@ module Shoulda
|
|
68
68
|
|
69
69
|
def disallowed_values
|
70
70
|
case @type
|
71
|
-
when :person then person_disallowed_values
|
72
|
-
when :legal then legal_disallowed_values
|
71
|
+
when :person then person_disallowed_values.deep_merge(legal_allowed_values)
|
72
|
+
when :legal then legal_disallowed_values.deep_merge(person_allowed_values)
|
73
73
|
else ValidatesIdentity::ShouldaMatchers.disallowed_values
|
74
74
|
end
|
75
75
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: validates_identity
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Paulo Ribeiro
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-02-
|
11
|
+
date: 2024-02-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activemodel
|