client_side_validations 20.0.1 → 20.0.2

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: 425f8909a6f06e2e3517c641b9f04627bec7e2c7b7a95ec79da2a471b30a156d
4
- data.tar.gz: 17ff1058ef71b8456b9de695363bf58351054641de0b94d472b15d7c33cee788
3
+ metadata.gz: 947a8c3e977a52425b7d60ca031c38ba6aa0e22534704859cf10330f42fc7c64
4
+ data.tar.gz: 120c000d994694b6cf98ceb28ed40507a43e28132563a1d03f43dde3bcf9a272
5
5
  SHA512:
6
- metadata.gz: 803c6e9370de4a64b0a491e6ca81a889224a0a17abce24975131a4067deff9d7495a1480ca6b4e78b737106b4ee50a72e945d05e83899d68d187434138bac08d
7
- data.tar.gz: 3bfe946cad1d6858a2e91fbad1d12b69b9564f9895189839681bf0663b1d8a53dcce868f5bfcf48bf59ce8b68c892e71e0b839f1d5b927b0d66ede1fec7cda9b
6
+ metadata.gz: 82dadc40eac82e9b38fca023d4732a8f6a3d835bc29f5b41ffa68345b8366a797c3a224ac0af0c8f50bc0067361c527741cf43bbf0d07779309134914c80231e
7
+ data.tar.gz: 125ae43cbb60726874f2ddba6aec7f355ebfb4e5a0e6cf7218cb42b9abb55d100e03f464a835b0b7490bc9232d55f73361cb759a0a3533b758ee0464b87b8717
data/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # Changelog
2
2
 
3
+ ## 20.0.2 / 2021-12-22
4
+
5
+ * [BUGFIX] Fix Rails 7.0 compatibility ([#869](https://github.com/DavyJonesLocker/client_side_validations/issues/869))
6
+
3
7
  ## 20.0.1 / 2021-12-22
4
8
 
5
9
  * [BUGFIX] Fix missing HTTP method ([#867](https://github.com/DavyJonesLocker/client_side_validations/issue/867))
@@ -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.class.field_error_proc.call(%(<span id="input_tag"></span>), Struct.new(:error_message, :tag_id).new([], '')),
33
- label_tag: form_helper.class.field_error_proc.call(%(<label id="label_tag"></label>), Struct.new(:error_message, :tag_id).new([], ''))
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
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module ClientSideValidations
4
- VERSION = '20.0.1'
4
+ VERSION = '20.0.2'
5
5
  end
@@ -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
  #
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: 20.0.1
4
+ version: 20.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Geremia Taglialatela