validates_identity 0.5.0 → 0.5.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
  SHA256:
3
- metadata.gz: 0fdb1765f269869de8c648faa317223189f37cb567b50f6a9caf2564f4611b9c
4
- data.tar.gz: 28402419c0136ab8b501b47e96bb292201212bb9f91a2c2b7534ff4d84e83bd4
3
+ metadata.gz: 9085025f8d95534d921da509e3c7ee686ff162982ada75797f49dd707054f45d
4
+ data.tar.gz: d13993171531b0d63a2f283594979f5ca28769b2b3686574d13ea345a1dafcff
5
5
  SHA512:
6
- metadata.gz: 376739a02e1cd0673babf91821c4cf3c44f4afdb79cb087ec91d1b31ad44fd48aa1eaa075f51399b1f356aa0dbd09784be5e38d9ef915560f5d109524e2a13a2
7
- data.tar.gz: f99028dfc1be6a94a2f597cf4fe451c21810b9931c6a311a85482998fa5b4fd87ea3ed1045af705c9132e41bdc16d1a6bdaabaff1e950ae8ac47c760ba201904
6
+ metadata.gz: 739b863e02256bae0369e1b67a434a9f5210b91762ebb7bcfca8ffe01580b100ce413aaea85b97f35161dff7974c2a08801e1b6d935dd62f76182c620b7faa31
7
+ data.tar.gz: dc0be85c6cce231a380642e181eae13cc8d62268a47f4779e1e3da6d7540b3d7159dd4a15b50162c55d25c17e61484d568b07cda5fb8a9bdcda180a4d1234292
data/CHANGELOG.md CHANGED
@@ -1,3 +1,15 @@
1
+ ## [0.5.2] - 2024-02-28
2
+
3
+ ### Fixed
4
+
5
+ - Matcher merging of allowed an disallowed values
6
+
7
+ ## [0.5.1] - 2024-02-28
8
+
9
+ ### Fixed
10
+
11
+ - Matcher missing parameter
12
+
1
13
  ## [0.5.0] - 2024-02-27
2
14
 
3
15
  ### Added
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- validates_identity (0.5.0)
4
+ validates_identity (0.5.2)
5
5
  activemodel
6
6
 
7
7
  GEM
@@ -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 = :both
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 + legal_allowed_values
72
- when :legal then legal_disallowed_values + person_allowed_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
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  class ValidatesIdentity
4
- VERSION = '0.5.0'
4
+ VERSION = '0.5.2'
5
5
  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.0
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-27 00:00:00.000000000 Z
11
+ date: 2024-02-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activemodel