client_side_validations 16.0.2 → 16.0.3

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: 11a781942eb32f699c3409faa441c7f72b4a6d49c5050f6ed677bf9202f3320c
4
- data.tar.gz: 88e915020768a159ecc2d2e85ae3577d5cfd73abe6d1e4dd9abee3d6554564fb
3
+ metadata.gz: 9893d8ea2559c48246a18e75f05032a3503708a7dbda3be04a822d6ca743e439
4
+ data.tar.gz: 6069c83656296d9811dadab566f89e019d626518f4612c920ab8ed7073b8c4f1
5
5
  SHA512:
6
- metadata.gz: 8327b3bd03f91b7114488dff342c42de349321ff8bd1d2992bfd1fdbc0f26996be91d76a5529aa5ecc5216c34aec3d1ee01d80fbb8592f4664a7ecbe1f80438a
7
- data.tar.gz: 481e25e87b9ff63897312328dd948953b1d9cf4b3991f1b271cda8d5c6b3dac81d18a3c2e9596a708467073b2b072c1af91067cd62d3a4ab918ba77ff1a93751
6
+ metadata.gz: 14988e0e4674b7870643fd56fc12eed129e7937f1b79a99afa62b5bc9516d40c7b407944738e0f80bfdfafcd72fecc2ce480f0d193e41152277bf9b3b9174c84
7
+ data.tar.gz: 6a56df2ab28a446ee19b0fc42d30743c4d72e8def54b693c9c9a82d1c1309a67350745d0f824f55fd28cf80eda26c565c69fe9afb72faee1fd89619fd7f4d6bf
@@ -1,5 +1,10 @@
1
1
  # Changelog
2
2
 
3
+ ## 16.0.3 / 2019-10-06
4
+
5
+ * [BUGFIX] Fix `validators.all` function
6
+ * [ENHANCEMENT] Update development dependencies
7
+
3
8
  ## 16.0.2 / 2019-09-21
4
9
 
5
10
  * [BUGFIX] Guard against prototype extended arrays ([#769](https://github.com/DavyJonesLocker/client_side_validations/pull/769))
data/README.md CHANGED
@@ -76,10 +76,17 @@ import '@client-side-validations/client-side-validations'
76
76
  require('@client-side-validations/client-side-validations')
77
77
  ```
78
78
 
79
- If you are using [Turbolinks](https://github.com/turbolinks/turbolinks),
80
- make sure that `@client-side-validations/client-side-validations` is imported
81
- (or required) **after** `Turbolinks.start()`, so ClientSideValidations can
82
- properly attach its event handlers.
79
+ ##### Heads-up for Turbolinks users #####
80
+
81
+ If you are using [Turbolinks](https://github.com/turbolinks/turbolinks) 5.2,
82
+ use the require syntax and make sure that `@client-side-validations/client-side-validations`
83
+ is required after`Turbolinks.start()`, so ClientSideValidations can properly
84
+ attach its event handlers.
85
+
86
+ Turbolinks 5.3 automatically calls `start()`, so you can use the `import` syntax.
87
+ Just make sure that `@client-side-validations/client-side-validations` is imported
88
+ **after** `turbolinks`, so ClientSideValidations can properly
89
+ attach its event handlers.
83
90
 
84
91
  #### When using Sprockets ####
85
92
 
@@ -16,5 +16,5 @@ end
16
16
 
17
17
  require 'client_side_validations/action_view/form_builder'
18
18
 
19
- ActionView::Base.send(:include, ClientSideValidations::ActionView::Helpers::FormHelper)
20
- ActionView::Helpers::FormBuilder.send(:prepend, ClientSideValidations::ActionView::Helpers::FormBuilder)
19
+ ActionView::Base.include ClientSideValidations::ActionView::Helpers::FormHelper
20
+ ActionView::Helpers::FormBuilder.prepend ClientSideValidations::ActionView::Helpers::FormBuilder
@@ -172,7 +172,7 @@ module ClientSideValidations
172
172
  end
173
173
  end
174
174
 
175
- ActiveModel::Validator.send(:include, ClientSideValidations::ActiveModel::Validator)
176
- ActiveModel::Validations.send(:include, ClientSideValidations::ActiveModel::Validations)
175
+ ActiveModel::Validator.include ClientSideValidations::ActiveModel::Validator
176
+ ActiveModel::Validations.include ClientSideValidations::ActiveModel::Validations
177
177
 
178
178
  ClientSideValidations::Extender.extend 'ActiveModel', %w[Absence Acceptance Exclusion Format Inclusion Length Numericality Presence]
@@ -3,6 +3,6 @@
3
3
  require 'client_side_validations/active_model'
4
4
  require 'client_side_validations/extender'
5
5
 
6
- ActiveRecord::Base.send(:include, ClientSideValidations::ActiveModel::Validations)
6
+ ActiveRecord::Base.include ClientSideValidations::ActiveModel::Validations
7
7
 
8
8
  ClientSideValidations::Extender.extend 'ActiveRecord', %w[Uniqueness]
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module ClientSideValidations
4
- VERSION = '16.0.2'
4
+ VERSION = '16.0.3'
5
5
  end
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * Client Side Validations JS - v0.0.5 (https://github.com/DavyJonesLocker/client_side_validations)
2
+ * Client Side Validations JS - v0.1.0 (https://github.com/DavyJonesLocker/client_side_validations)
3
3
  * Copyright (c) 2019 Geremia Taglialatela, Brian Cardarella
4
4
  * Licensed under MIT (https://opensource.org/licenses/mit-license.php)
5
5
  */
@@ -219,7 +219,7 @@
219
219
  },
220
220
  validators: {
221
221
  all: function all() {
222
- return $.extend({});
222
+ return $.extend({}, ClientSideValidations.validators.local, ClientSideValidations.validators.remote);
223
223
  },
224
224
  local: {},
225
225
  remote: {}
@@ -726,12 +726,14 @@
726
726
  };
727
727
 
728
728
  var executeAllValidators = function executeAllValidators(element, validators) {
729
- if (element.data('changed') !== false) {
730
- element.data('changed', false);
729
+ if (element.data('changed') === false) {
730
+ return;
731
+ }
731
732
 
732
- if (executeValidators(ClientSideValidations.validators.local, element, validators) && executeValidators(ClientSideValidations.validators.remote, element, validators)) {
733
- passElement(element);
734
- }
733
+ element.data('changed', false);
734
+
735
+ if (executeValidators(ClientSideValidations.validators.all(), element, validators)) {
736
+ passElement(element);
735
737
  }
736
738
  };
737
739
 
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: 16.0.2
4
+ version: 16.0.3
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-09-21 00:00:00.000000000 Z
12
+ date: 2019-10-06 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rails
@@ -127,14 +127,14 @@ dependencies:
127
127
  requirements:
128
128
  - - "~>"
129
129
  - !ruby/object:Gem::Version
130
- version: '5.11'
130
+ version: '5.12'
131
131
  type: :development
132
132
  prerelease: false
133
133
  version_requirements: !ruby/object:Gem::Requirement
134
134
  requirements:
135
135
  - - "~>"
136
136
  - !ruby/object:Gem::Version
137
- version: '5.11'
137
+ version: '5.12'
138
138
  - !ruby/object:Gem::Dependency
139
139
  name: mocha
140
140
  requirement: !ruby/object:Gem::Requirement
@@ -155,42 +155,42 @@ dependencies:
155
155
  requirements:
156
156
  - - "~>"
157
157
  - !ruby/object:Gem::Version
158
- version: '12.3'
158
+ version: '13.0'
159
159
  type: :development
160
160
  prerelease: false
161
161
  version_requirements: !ruby/object:Gem::Requirement
162
162
  requirements:
163
163
  - - "~>"
164
164
  - !ruby/object:Gem::Version
165
- version: '12.3'
165
+ version: '13.0'
166
166
  - !ruby/object:Gem::Dependency
167
167
  name: rubocop
168
168
  requirement: !ruby/object:Gem::Requirement
169
169
  requirements:
170
170
  - - "~>"
171
171
  - !ruby/object:Gem::Version
172
- version: 0.74.0
172
+ version: 0.75.0
173
173
  type: :development
174
174
  prerelease: false
175
175
  version_requirements: !ruby/object:Gem::Requirement
176
176
  requirements:
177
177
  - - "~>"
178
178
  - !ruby/object:Gem::Version
179
- version: 0.74.0
179
+ version: 0.75.0
180
180
  - !ruby/object:Gem::Dependency
181
181
  name: rubocop-performance
182
182
  requirement: !ruby/object:Gem::Requirement
183
183
  requirements:
184
184
  - - "~>"
185
185
  - !ruby/object:Gem::Version
186
- version: '1.4'
186
+ version: '1.5'
187
187
  type: :development
188
188
  prerelease: false
189
189
  version_requirements: !ruby/object:Gem::Requirement
190
190
  requirements:
191
191
  - - "~>"
192
192
  - !ruby/object:Gem::Version
193
- version: '1.4'
193
+ version: '1.5'
194
194
  - !ruby/object:Gem::Dependency
195
195
  name: rubocop-rails
196
196
  requirement: !ruby/object:Gem::Requirement