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 +4 -4
- data/CHANGELOG.md +5 -0
- data/README.md +11 -4
- data/lib/client_side_validations/action_view.rb +2 -2
- data/lib/client_side_validations/active_model.rb +2 -2
- data/lib/client_side_validations/active_record.rb +1 -1
- data/lib/client_side_validations/version.rb +1 -1
- data/vendor/assets/javascripts/rails.validations.js +9 -7
- metadata +10 -10
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9893d8ea2559c48246a18e75f05032a3503708a7dbda3be04a822d6ca743e439
|
4
|
+
data.tar.gz: 6069c83656296d9811dadab566f89e019d626518f4612c920ab8ed7073b8c4f1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 14988e0e4674b7870643fd56fc12eed129e7937f1b79a99afa62b5bc9516d40c7b407944738e0f80bfdfafcd72fecc2ce480f0d193e41152277bf9b3b9174c84
|
7
|
+
data.tar.gz: 6a56df2ab28a446ee19b0fc42d30743c4d72e8def54b693c9c9a82d1c1309a67350745d0f824f55fd28cf80eda26c565c69fe9afb72faee1fd89619fd7f4d6bf
|
data/CHANGELOG.md
CHANGED
@@ -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
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
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.
|
20
|
-
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.
|
176
|
-
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.
|
6
|
+
ActiveRecord::Base.include ClientSideValidations::ActiveModel::Validations
|
7
7
|
|
8
8
|
ClientSideValidations::Extender.extend 'ActiveRecord', %w[Uniqueness]
|
@@ -1,5 +1,5 @@
|
|
1
1
|
/*!
|
2
|
-
* Client Side Validations JS - v0.0
|
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')
|
730
|
-
|
729
|
+
if (element.data('changed') === false) {
|
730
|
+
return;
|
731
|
+
}
|
731
732
|
|
732
|
-
|
733
|
-
|
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.
|
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-
|
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.
|
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.
|
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: '
|
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: '
|
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.
|
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.
|
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.
|
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.
|
193
|
+
version: '1.5'
|
194
194
|
- !ruby/object:Gem::Dependency
|
195
195
|
name: rubocop-rails
|
196
196
|
requirement: !ruby/object:Gem::Requirement
|