client_side_validations 12.1.0 → 13.0.0

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: d318eadd163f52eed8bca389cd6c95f9f9d65c478a566777035661bb83be80f7
4
- data.tar.gz: 44b0a6d561372a831dcfdc4fa9abec4dbda74223dade1dfb955f5e8899fee0cf
3
+ metadata.gz: e341134d35bb7b45d50e4a7d3cc67a9998baf197328f266fe2952739be5ef938
4
+ data.tar.gz: 9e4322685d843d6b3e0dd79fa1f189f9af21301878c31d9ca9a4ec8fd0d90af4
5
5
  SHA512:
6
- metadata.gz: be62734fcbac0e98341e8c2c2afd5132b69531097751c9317e4b451235b26ab6e89c2865f12b14807307663c346d231a9e9f8ebf7690cbe62f46d3db6b9ad96a
7
- data.tar.gz: 99ad764cbc4bd55e0fecc56a059b8c13c14dc7ef47ddfc78c394189c55f1dc248f9de105e3b769092a591b55b60554ec192ba36d9a17e6650795488f51640331
6
+ metadata.gz: 241fc551a848a822d4d587d9d0752f94bf2ab26ca3eded5391fe8864be12381e90cbd33bf959576194302c5904783b755d2a3e5a82294629a2f3f8406efc3597
7
+ data.tar.gz: 606783d3945f37763802350bf50c9fce082686b4f1440fa39a547afa2f9be214e443713cd47c3ba43d1a8ab35db7eef8735530acad71653a09828f9e4c25b482
@@ -1,5 +1,12 @@
1
1
  # Changelog
2
2
 
3
+ ## 13.0.0 / 2019-03-01
4
+
5
+ * [FEATURE] Add Rails 6.0.0.beta2 compatibility
6
+ * [BUGFIX] Fix case-sensitive uniqueness validator (potential breaking change) ([#753](https://github.com/DavyJonesLocker/client_side_validations/issues/753))
7
+ * [ENHANCEMENT] Test against Ruby 2.6.1
8
+ * [ENHANCEMENT] Update dependencies
9
+
3
10
  ## 12.1.0 / 2019-01-21
4
11
 
5
12
  * [FEATURE] Add Rails 6.0.0.beta1 compatibility
@@ -6,7 +6,7 @@ module ClientSideValidations
6
6
  def client_side_hash(model, attribute, _force = nil)
7
7
  hash = {}
8
8
  hash[:message] = model.errors.generate_message(attribute, message_type, options.except(:scope))
9
- hash[:case_sensitive] = options[:case_sensitive]
9
+ hash[:case_sensitive] = true if options[:case_sensitive]
10
10
  hash[:id] = model.id unless model.new_record?
11
11
  hash[:allow_blank] = true if options[:allow_nil] || options[:allow_blank]
12
12
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module ClientSideValidations
4
- VERSION = '12.1.0'.freeze
4
+ VERSION = '13.0.0'.freeze
5
5
  end
@@ -1,6 +1,6 @@
1
1
 
2
2
  /*!
3
- * Client Side Validations - v12.1.0 (https://github.com/DavyJonesLocker/client_side_validations)
3
+ * Client Side Validations - v13.0.0 (https://github.com/DavyJonesLocker/client_side_validations)
4
4
  * Copyright (c) 2019 Geremia Taglialatela, Brian Cardarella
5
5
  * Licensed under MIT (http://opensource.org/licenses/mit-license.php)
6
6
  */
@@ -535,8 +535,14 @@
535
535
  form = element.closest('form');
536
536
  valid = true;
537
537
  form.find(":input[name^=\"" + name_prefix + "\"][name$=\"" + name_suffix + "\"]").each(function() {
538
+ var other_value;
539
+ other_value = $(this).val();
540
+ if (!options.case_sensitive) {
541
+ value = value.toLowerCase();
542
+ other_value = other_value.toLowerCase();
543
+ }
538
544
  if ($(this).attr('name') !== name) {
539
- if ($(this).val() === value) {
545
+ if (other_value === value) {
540
546
  valid = false;
541
547
  return $(this).data('notLocallyUnique', true);
542
548
  } else {
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: client_side_validations
3
3
  version: !ruby/object:Gem::Version
4
- version: 12.1.0
4
+ version: 13.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Geremia Taglialatela
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2019-01-22 00:00:00.000000000 Z
12
+ date: 2019-03-01 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rails
@@ -20,7 +20,7 @@ dependencies:
20
20
  version: 5.0.0.1
21
21
  - - "<="
22
22
  - !ruby/object:Gem::Version
23
- version: 6.0.0.beta1
23
+ version: 6.0.0.beta2
24
24
  type: :runtime
25
25
  prerelease: false
26
26
  version_requirements: !ruby/object:Gem::Requirement
@@ -30,7 +30,7 @@ dependencies:
30
30
  version: 5.0.0.1
31
31
  - - "<="
32
32
  - !ruby/object:Gem::Version
33
- version: 6.0.0.beta1
33
+ version: 6.0.0.beta2
34
34
  - !ruby/object:Gem::Dependency
35
35
  name: jquery-rails
36
36
  requirement: !ruby/object:Gem::Requirement
@@ -77,16 +77,22 @@ dependencies:
77
77
  name: byebug
78
78
  requirement: !ruby/object:Gem::Requirement
79
79
  requirements:
80
- - - "~>"
80
+ - - ">="
81
81
  - !ruby/object:Gem::Version
82
82
  version: '10.0'
83
+ - - "<"
84
+ - !ruby/object:Gem::Version
85
+ version: '12'
83
86
  type: :development
84
87
  prerelease: false
85
88
  version_requirements: !ruby/object:Gem::Requirement
86
89
  requirements:
87
- - - "~>"
90
+ - - ">="
88
91
  - !ruby/object:Gem::Version
89
92
  version: '10.0'
93
+ - - "<"
94
+ - !ruby/object:Gem::Version
95
+ version: '12'
90
96
  - !ruby/object:Gem::Dependency
91
97
  name: coveralls_reborn
92
98
  requirement: !ruby/object:Gem::Requirement
@@ -163,14 +169,14 @@ dependencies:
163
169
  requirements:
164
170
  - - "~>"
165
171
  - !ruby/object:Gem::Version
166
- version: 0.63.0
172
+ version: 0.65.0
167
173
  type: :development
168
174
  prerelease: false
169
175
  version_requirements: !ruby/object:Gem::Requirement
170
176
  requirements:
171
177
  - - "~>"
172
178
  - !ruby/object:Gem::Version
173
- version: 0.63.0
179
+ version: 0.65.0
174
180
  - !ruby/object:Gem::Dependency
175
181
  name: simplecov
176
182
  requirement: !ruby/object:Gem::Requirement
@@ -191,14 +197,14 @@ dependencies:
191
197
  requirements:
192
198
  - - "~>"
193
199
  - !ruby/object:Gem::Version
194
- version: '1.3'
200
+ version: 1.3.6
195
201
  type: :development
196
202
  prerelease: false
197
203
  version_requirements: !ruby/object:Gem::Requirement
198
204
  requirements:
199
205
  - - "~>"
200
206
  - !ruby/object:Gem::Version
201
- version: '1.3'
207
+ version: 1.3.6
202
208
  - !ruby/object:Gem::Dependency
203
209
  name: coffee-script
204
210
  requirement: !ruby/object:Gem::Requirement
@@ -315,7 +321,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
315
321
  - !ruby/object:Gem::Version
316
322
  version: '0'
317
323
  requirements: []
318
- rubygems_version: 3.0.1
324
+ rubygems_version: 3.0.2
319
325
  signing_key:
320
326
  specification_version: 4
321
327
  summary: Client Side Validations