client_side_validations 20.0.1 → 21.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +12 -0
- data/LICENSE.md +1 -1
- data/README.md +1 -1
- data/lib/client_side_validations/action_view/form_builder.rb +8 -2
- data/lib/client_side_validations/action_view.rb +1 -1
- data/lib/client_side_validations/active_model/numericality.rb +1 -1
- data/lib/client_side_validations/active_record.rb +1 -1
- data/lib/client_side_validations/version.rb +1 -1
- data/lib/generators/templates/client_side_validations/initializer.rb +3 -0
- data/vendor/assets/javascripts/rails.validations.js +1 -1
- metadata +16 -16
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d1fde76e476a73b701937d5106237ac4525233bb70f3fe6cacbc8367b66cc85e
|
4
|
+
data.tar.gz: 561af4b98912431057feb7eec2ef1ce8493f8a92e741b9f42c5f13ea8c608164
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f596d52b77b55949970f9bc4bed5a2086fafc8f4130f65d925587389e45d223382cba6ee0dd4d0debef1cf13d8814ffab29a5a3ea5252925c87649f10fd8f9c0
|
7
|
+
data.tar.gz: 8647fa1b7f8e79a8510f71fd7f0e94f0f60aaf948c67925f026f83d6f0c9fed2faefb98d936ee7bcbcb6dc84780f9a5a2b0a44bea04c9d96892714e4a5535d3e
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,17 @@
|
|
1
1
|
# Changelog
|
2
2
|
|
3
|
+
## 21.0.0 / 2022-09-18
|
4
|
+
|
5
|
+
* [FEATURE] Drop Ruby 2.5 support
|
6
|
+
* [ENHANCEMENT] Test against latest Ruby versions
|
7
|
+
* [ENHANCEMENT] Update development dependencies
|
8
|
+
* [ENHANCEMENT] Update QUnit to 2.19.1
|
9
|
+
* [ENHANCEMENT] Test against jQuery 3.6.1 by default
|
10
|
+
|
11
|
+
## 20.0.2 / 2021-12-22
|
12
|
+
|
13
|
+
* [BUGFIX] Fix Rails 7.0 compatibility ([#869](https://github.com/DavyJonesLocker/client_side_validations/issues/869))
|
14
|
+
|
3
15
|
## 20.0.1 / 2021-12-22
|
4
16
|
|
5
17
|
* [BUGFIX] Fix missing HTTP method ([#867](https://github.com/DavyJonesLocker/client_side_validations/issue/867))
|
data/LICENSE.md
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
The MIT License (MIT)
|
2
2
|
|
3
|
-
Copyright (c)
|
3
|
+
Copyright (c) 2022 Geremia Taglialatela, Brian Cardarella
|
4
4
|
|
5
5
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
6
|
of this software and associated documentation files (the "Software"), to deal
|
data/README.md
CHANGED
@@ -29,8 +29,8 @@ module ClientSideValidations
|
|
29
29
|
def client_side_form_settings(_options, form_helper)
|
30
30
|
{
|
31
31
|
type: self.class.to_s,
|
32
|
-
input_tag: form_helper
|
33
|
-
label_tag: form_helper
|
32
|
+
input_tag: error_field(form_helper, :span, 'input_tag'),
|
33
|
+
label_tag: error_field(form_helper, :label, 'label_tag')
|
34
34
|
}
|
35
35
|
end
|
36
36
|
|
@@ -109,6 +109,12 @@ module ClientSideValidations
|
|
109
109
|
|
110
110
|
private
|
111
111
|
|
112
|
+
def error_field(form_helper, tag, id)
|
113
|
+
form_helper.instance_exec form_helper.content_tag(tag, nil, id: id),
|
114
|
+
Struct.new(:error_message, :tag_id).new([], ''),
|
115
|
+
&form_helper.class.field_error_proc
|
116
|
+
end
|
117
|
+
|
112
118
|
def build_validation_options(method, options = {})
|
113
119
|
return unless @options[:validate]
|
114
120
|
|
@@ -16,5 +16,5 @@ end
|
|
16
16
|
|
17
17
|
require 'client_side_validations/action_view/form_builder'
|
18
18
|
|
19
|
-
|
19
|
+
ActiveSupport.on_load(:action_view) { include ClientSideValidations::ActionView::Helpers::FormHelper }
|
20
20
|
ActionView::Helpers::FormBuilder.prepend ClientSideValidations::ActionView::Helpers::FormBuilder
|
@@ -3,6 +3,6 @@
|
|
3
3
|
require 'client_side_validations/active_model'
|
4
4
|
require 'client_side_validations/extender'
|
5
5
|
|
6
|
-
|
6
|
+
ActiveSupport.on_load(:active_record) { include ClientSideValidations::ActiveModel::Validations }
|
7
7
|
|
8
8
|
ClientSideValidations::Extender.extend 'ActiveRecord', %w[Uniqueness]
|
@@ -9,6 +9,9 @@
|
|
9
9
|
|
10
10
|
# Uncomment the following block if you want each input field to have the validation messages attached.
|
11
11
|
#
|
12
|
+
# Alternatively, for a cleaner approach, it is possible to set
|
13
|
+
# `config.action_view.field_error_proc` in the application configuration
|
14
|
+
#
|
12
15
|
# Note: client_side_validation requires the error to be encapsulated within
|
13
16
|
# <label for="#{instance.send(:tag_id)}" class="message"></label>
|
14
17
|
#
|
@@ -1,6 +1,6 @@
|
|
1
1
|
/*!
|
2
2
|
* Client Side Validations JS - v0.3.0 (https://github.com/DavyJonesLocker/client_side_validations)
|
3
|
-
* Copyright (c)
|
3
|
+
* Copyright (c) 2022 Geremia Taglialatela, Brian Cardarella
|
4
4
|
* Licensed under MIT (https://opensource.org/licenses/mit-license.php)
|
5
5
|
*/
|
6
6
|
|
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:
|
4
|
+
version: 21.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:
|
12
|
+
date: 2022-09-18 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rails
|
@@ -37,14 +37,14 @@ dependencies:
|
|
37
37
|
requirements:
|
38
38
|
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: '3.
|
40
|
+
version: '3.7'
|
41
41
|
type: :runtime
|
42
42
|
prerelease: false
|
43
43
|
version_requirements: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
45
|
- - "~>"
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version: '3.
|
47
|
+
version: '3.7'
|
48
48
|
- !ruby/object:Gem::Dependency
|
49
49
|
name: appraisal
|
50
50
|
requirement: !ruby/object:Gem::Requirement
|
@@ -79,42 +79,42 @@ dependencies:
|
|
79
79
|
requirements:
|
80
80
|
- - "~>"
|
81
81
|
- !ruby/object:Gem::Version
|
82
|
-
version: '1.
|
82
|
+
version: '1.6'
|
83
83
|
type: :development
|
84
84
|
prerelease: false
|
85
85
|
version_requirements: !ruby/object:Gem::Requirement
|
86
86
|
requirements:
|
87
87
|
- - "~>"
|
88
88
|
- !ruby/object:Gem::Version
|
89
|
-
version: '1.
|
89
|
+
version: '1.6'
|
90
90
|
- !ruby/object:Gem::Dependency
|
91
91
|
name: minitest
|
92
92
|
requirement: !ruby/object:Gem::Requirement
|
93
93
|
requirements:
|
94
94
|
- - "~>"
|
95
95
|
- !ruby/object:Gem::Version
|
96
|
-
version: '5.
|
96
|
+
version: '5.16'
|
97
97
|
type: :development
|
98
98
|
prerelease: false
|
99
99
|
version_requirements: !ruby/object:Gem::Requirement
|
100
100
|
requirements:
|
101
101
|
- - "~>"
|
102
102
|
- !ruby/object:Gem::Version
|
103
|
-
version: '5.
|
103
|
+
version: '5.16'
|
104
104
|
- !ruby/object:Gem::Dependency
|
105
105
|
name: mocha
|
106
106
|
requirement: !ruby/object:Gem::Requirement
|
107
107
|
requirements:
|
108
108
|
- - "~>"
|
109
109
|
- !ruby/object:Gem::Version
|
110
|
-
version: '1.
|
110
|
+
version: '1.14'
|
111
111
|
type: :development
|
112
112
|
prerelease: false
|
113
113
|
version_requirements: !ruby/object:Gem::Requirement
|
114
114
|
requirements:
|
115
115
|
- - "~>"
|
116
116
|
- !ruby/object:Gem::Version
|
117
|
-
version: '1.
|
117
|
+
version: '1.14'
|
118
118
|
- !ruby/object:Gem::Dependency
|
119
119
|
name: rake
|
120
120
|
requirement: !ruby/object:Gem::Requirement
|
@@ -163,14 +163,14 @@ dependencies:
|
|
163
163
|
requirements:
|
164
164
|
- - "~>"
|
165
165
|
- !ruby/object:Gem::Version
|
166
|
-
version: '1.
|
166
|
+
version: '1.5'
|
167
167
|
type: :development
|
168
168
|
prerelease: false
|
169
169
|
version_requirements: !ruby/object:Gem::Requirement
|
170
170
|
requirements:
|
171
171
|
- - "~>"
|
172
172
|
- !ruby/object:Gem::Version
|
173
|
-
version: '1.
|
173
|
+
version: '1.5'
|
174
174
|
- !ruby/object:Gem::Dependency
|
175
175
|
name: shotgun
|
176
176
|
requirement: !ruby/object:Gem::Requirement
|
@@ -191,14 +191,14 @@ dependencies:
|
|
191
191
|
requirements:
|
192
192
|
- - "~>"
|
193
193
|
- !ruby/object:Gem::Version
|
194
|
-
version: '2.
|
194
|
+
version: '2.2'
|
195
195
|
type: :development
|
196
196
|
prerelease: false
|
197
197
|
version_requirements: !ruby/object:Gem::Requirement
|
198
198
|
requirements:
|
199
199
|
- - "~>"
|
200
200
|
- !ruby/object:Gem::Version
|
201
|
-
version: '2.
|
201
|
+
version: '2.2'
|
202
202
|
- !ruby/object:Gem::Dependency
|
203
203
|
name: webrick
|
204
204
|
requirement: !ruby/object:Gem::Requirement
|
@@ -271,14 +271,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
271
271
|
requirements:
|
272
272
|
- - ">="
|
273
273
|
- !ruby/object:Gem::Version
|
274
|
-
version: '2.
|
274
|
+
version: '2.6'
|
275
275
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
276
276
|
requirements:
|
277
277
|
- - ">="
|
278
278
|
- !ruby/object:Gem::Version
|
279
279
|
version: '0'
|
280
280
|
requirements: []
|
281
|
-
rubygems_version: 3.
|
281
|
+
rubygems_version: 3.3.12
|
282
282
|
signing_key:
|
283
283
|
specification_version: 4
|
284
284
|
summary: Client Side Validations
|