database_validations 0.9.0 → 0.9.1

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
  SHA256:
3
- metadata.gz: 70578fbf45115b1b0a349f2676b2c1a689f2aa8d29da2da189da263306c0b333
4
- data.tar.gz: f6fc66d339e488cccdf750103637543ecd39d34a0a84366efa2382addcde6aee
3
+ metadata.gz: 7611b039f9baa05f65bee0a18cbfc2cfe2c0ae5e7f69bc01d232b00de5306f92
4
+ data.tar.gz: 9601fd3196555c0d861b5fb1a3809d25814453db9199fbcc0b115b7976a3012d
5
5
  SHA512:
6
- metadata.gz: 6d40cf1b7d776cf984846f9cef85f1969271d619ae4ee9b9127fe67307c8983eb0ce385883541394932d9cc1f88a2e69fccdf5ff6b800ee06c5a1f5710b21495
7
- data.tar.gz: 1e94c35ae4a40a56e275b6bad79a05cf0c3f29b735cf37495c2fb5e9013d2929ab0a54f025c6221a5fa8179a26d3660c9518ba8d5c1f4310ea3832b4ab4cdb28
6
+ metadata.gz: 8a72b136bdd5528cf93dc019c80ecf88b09a9484a68d523e5574e28ee7ffb122122eda7cf3062655015f59637d4dd06de4c3c028c79067fea101b326f15a80e6
7
+ data.tar.gz: bb9ee57860b06c58853db54583b08acd953f0cdf037d0e11a5faee3b72aa748b022051b3ee21a8fbe3d95f18f7c460c5a1d91e77cbbd2bdf5d4237802b9d8ad4
@@ -5,7 +5,7 @@ module DatabaseValidations
5
5
 
6
6
  class << self
7
7
  def unique_index_name(error_message)
8
- error_message[/key '([^']+)'/, 1]
8
+ error_message[/key '([^']+)'/, 1]&.split('.')&.last
9
9
  end
10
10
 
11
11
  def unique_error_columns(_error_message); end
@@ -41,6 +41,10 @@ RSpec::Matchers.define :validate_db_uniqueness_of do |field| # rubocop:disable M
41
41
  @case_sensitive = false
42
42
  end
43
43
 
44
+ chain(:case_sensitive) do
45
+ @case_sensitive = true
46
+ end
47
+
44
48
  match do |object|
45
49
  @validators = []
46
50
 
@@ -79,6 +83,7 @@ RSpec::Matchers.define :validate_db_uniqueness_of do |field| # rubocop:disable M
79
83
  desc += "where: '#{@where}'; " if @where
80
84
  desc += "index_name: '#{@index_name}'; " if @index_name
81
85
  desc += 'be case insensitive.' unless @case_sensitive
86
+ desc += 'be case sensitive.' if @case_sensitive
82
87
  desc
83
88
  end
84
89
 
@@ -1,3 +1,3 @@
1
1
  module DatabaseValidations
2
- VERSION = '0.9.0'.freeze
2
+ VERSION = '0.9.1'.freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: database_validations
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.0
4
+ version: 0.9.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Evgeniy Demin
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-08-18 00:00:00.000000000 Z
11
+ date: 2020-06-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activerecord
@@ -100,14 +100,14 @@ dependencies:
100
100
  requirements:
101
101
  - - "~>"
102
102
  - !ruby/object:Gem::Version
103
- version: '12.3'
103
+ version: '13.0'
104
104
  type: :development
105
105
  prerelease: false
106
106
  version_requirements: !ruby/object:Gem::Requirement
107
107
  requirements:
108
108
  - - "~>"
109
109
  - !ruby/object:Gem::Version
110
- version: '12.3'
110
+ version: '13.0'
111
111
  - !ruby/object:Gem::Dependency
112
112
  name: rspec
113
113
  requirement: !ruby/object:Gem::Requirement
@@ -208,7 +208,7 @@ homepage: https://github.com/toptal/database_validations
208
208
  licenses:
209
209
  - MIT
210
210
  metadata: {}
211
- post_install_message:
211
+ post_install_message:
212
212
  rdoc_options: []
213
213
  require_paths:
214
214
  - lib
@@ -223,9 +223,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
223
223
  - !ruby/object:Gem::Version
224
224
  version: '0'
225
225
  requirements: []
226
- rubyforge_project:
227
- rubygems_version: 2.7.9
228
- signing_key:
226
+ rubygems_version: 3.1.2
227
+ signing_key:
229
228
  specification_version: 4
230
229
  summary: Provide compatibility between database constraints and ActiveRecord validations
231
230
  with better performance and consistency.