client_side_validations 22.1.0 → 22.2.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: 0031ae9ccb119721454af916e0b6796104655e332c9617d37c33d34fbaebc24c
4
- data.tar.gz: 6c40bd5b85d1e7d3537e7c37540e2ca09bdcb854c8ea3cf8e7d433d43cbb4fcf
3
+ metadata.gz: 35e341b74ca2a5e885ff8306cc7ba2270c4dc5fcc5a44deaeed7256e9fed0e11
4
+ data.tar.gz: 34bb3f201ed59e17af087541c779af80292108f1c5661ed0a69c59e5a3638c38
5
5
  SHA512:
6
- metadata.gz: 5b366be2677516494cda669b702d017a994f137ebab8372a37de716dc34e504ee46c9fbf3dd665e7427248dc106ce5d29360a7f9f4edb75b821f4fe6a87eebe5
7
- data.tar.gz: 1c27ff9b07dd1face8d867295ff30b2c578244617f885ee3aa57a3b95d5517745b4188b97a19c5889e56846c182e1cd0c9bfc623d222cba972bc365aa6b9faa4
6
+ metadata.gz: 9ba714585652b3a19e307f79d44c0c50259c3c421f8c64445718b9c56c041d8e5b3296e5e21a444747b975383503dbf95afe5eb5d5e664a1b0dc9b2427c11648
7
+ data.tar.gz: 989fdc90e7459cfa942666bb5dbab62fb49d6abe5c86c696e368bcbd1b1398b4d1ffdd64b966b6e9d9c19602a5b936a144792a2fbdc4292718d5b11c27daf477
data/CHANGELOG.md CHANGED
@@ -1,5 +1,15 @@
1
1
  # Changelog
2
2
 
3
+ ## 22.2.0 / 2026-06-01
4
+
5
+ * [FEATURE] Allow Rails 8.0 alpha
6
+ * [ENHANCEMENT] Test against Ruby 3.3
7
+ * [ENHANCEMENT] Update QUnit to 2.21.0
8
+
9
+ ## 22.1.1 / 2023-10-08
10
+
11
+ * [BUGFIX] Fix a bug with missing translations ([#920](https://github.com/DavyJonesLocker/client_side_validations/issues/920))
12
+
3
13
  ## 22.1.0 / 2023-10-05
4
14
 
5
15
  * [FEATURE] Rails 7.1 compatibility
@@ -227,7 +237,7 @@
227
237
 
228
238
  * [FEATURE] Refactor client-side numericality validator ([#717](https://github.com/DavyJonesLocker/client_side_validations/issues/717))
229
239
  * [ENHANCEMENT] Test against Ruby 2.2.8, 2.3.5, and 2.4.2
230
- * [ENHANCEMENT] Update js_regex runtime depenency to 2.0
240
+ * [ENHANCEMENT] Update js_regex runtime dependency to 2.0
231
241
  * [ENHANCEMENT] Update development dependencies
232
242
 
233
243
  ## 9.3.4 / 2017-07-15
@@ -261,7 +271,7 @@
261
271
  * [ENHANCEMENT] Code cleanup
262
272
  * [ENHANCEMENT] Test against Ruby 2.4.1 and Rails 5.1.0.rc1
263
273
  * [ENHANCEMENT] Test against jQuery 3.2.0 and 3.2.1
264
- * [ENHANCEMENT] Update jquery-rails runtime depenency to 4.3
274
+ * [ENHANCEMENT] Update jquery-rails runtime dependency to 4.3
265
275
  * [ENHANCEMENT] Update development dependencies
266
276
 
267
277
  ## 9.1.0 / 2017-03-07
data/LICENSE.md CHANGED
@@ -1,6 +1,6 @@
1
1
  The MIT License (MIT)
2
2
 
3
- Copyright (c) 2023 Geremia Taglialatela, Brian Cardarella
3
+ Copyright (c) 2024 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
@@ -543,7 +543,7 @@ on how to properly submit issues and pull requests.
543
543
 
544
544
  ## Legal ##
545
545
 
546
- [DockYard](https://dockyard.com/), LLC © 2012-2023
546
+ [DockYard](https://dockyard.com/), LLC © 2012-2024
547
547
 
548
548
  [@dockyard](https://twitter.com/dockyard)
549
549
 
@@ -18,7 +18,24 @@ module ClientSideValidations
18
18
  private
19
19
 
20
20
  def build_client_side_hash(model, attribute, options)
21
- { message: model.errors.generate_message(attribute, message_type, options) }.merge(options.except(*callbacks_options - %i[allow_blank if unless]))
21
+ # Rails mutates `options` object when calling `model.errors.generate_message`
22
+ # by removing `message` option, if any.
23
+ # By raising on missing translations, CSV has the same behavior across
24
+ # all supported Rails versions and `config.i18n.raise_on_missing_translations`
25
+ # possible configurations.
26
+ options[:raise] = true
27
+
28
+ message =
29
+ begin
30
+ model.errors.generate_message(attribute, message_type, options)
31
+ rescue I18n::MissingTranslationData
32
+ options[:message] = :invalid
33
+ model.errors.generate_message(attribute, message_type, options)
34
+ end
35
+
36
+ options.delete(:raise)
37
+
38
+ { message: message }.merge(options.except(*callbacks_options - %i[allow_blank if unless]))
22
39
  end
23
40
 
24
41
  def message_type
@@ -7,7 +7,8 @@ module ClientSideValidations
7
7
  def extend(klass, validators)
8
8
  validators.each do |validator|
9
9
  require "client_side_validations/#{klass.underscore}/#{validator.downcase}"
10
- const_get(klass)::Validations.const_get("#{validator}Validator").send :include, ClientSideValidations.const_get(klass).const_get(validator)
10
+
11
+ const_get(klass)::Validations.const_get(:"#{validator}Validator").include ClientSideValidations.const_get(klass).const_get(validator)
11
12
  end
12
13
  end
13
14
  end
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- # This is only used by dependant libraries that need to find the files
3
+ # This is only used by dependent libraries that need to find the files
4
4
 
5
5
  module ClientSideValidations
6
6
  module Files
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module ClientSideValidations
4
- VERSION = '22.1.0'
4
+ VERSION = '22.2.0'
5
5
  end
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  # ClientSideValidations Initializer
3
4
 
4
5
  # Disabled validators
@@ -16,7 +17,7 @@
16
17
  # <label for="#{instance.send(:tag_id)}" class="message"></label>
17
18
  #
18
19
  # ActionView::Base.field_error_proc = proc do |html_tag, instance|
19
- # if html_tag =~ /^<label/
20
+ # if /^<label/.match?(html_tag)
20
21
  # %(<div class="field_with_errors">#{html_tag}</div>).html_safe
21
22
  # else
22
23
  # %(<div class="field_with_errors">#{html_tag}<label for="#{instance.send(:tag_id)}" class="message">#{instance.error_message.first}</label></div>).html_safe
@@ -1,6 +1,6 @@
1
1
  /*!
2
2
  * Client Side Validations JS - v0.4.0 (https://github.com/DavyJonesLocker/client_side_validations)
3
- * Copyright (c) 2023 Geremia Taglialatela, Brian Cardarella
3
+ * Copyright (c) 2024 Geremia Taglialatela, Brian Cardarella
4
4
  * Licensed under MIT (https://opensource.org/licenses/mit-license.php)
5
5
  */
6
6
 
@@ -700,7 +700,6 @@
700
700
  function isAMD() {
701
701
  return typeof define === 'function' && define.amd; // eslint-disable-line no-undef
702
702
  }
703
-
704
703
  function isCommonJS() {
705
704
  return (typeof exports === "undefined" ? "undefined" : _typeof(exports)) === 'object' && typeof module !== 'undefined'; // eslint-disable-line no-undef
706
705
  }
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: 22.1.0
4
+ version: 22.2.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: 2023-10-05 00:00:00.000000000 Z
12
+ date: 2024-06-01 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: js_regex
@@ -34,7 +34,7 @@ dependencies:
34
34
  version: '6.1'
35
35
  - - "<"
36
36
  - !ruby/object:Gem::Version
37
- version: '7.2'
37
+ version: '8.0'
38
38
  type: :runtime
39
39
  prerelease: false
40
40
  version_requirements: !ruby/object:Gem::Requirement
@@ -44,8 +44,8 @@ dependencies:
44
44
  version: '6.1'
45
45
  - - "<"
46
46
  - !ruby/object:Gem::Version
47
- version: '7.2'
48
- description: Client Side Validations made easy for your Rails 5 applications
47
+ version: '8.0'
48
+ description: Client Side Validations made easy for your Rails 6.1 and 7.x applications
49
49
  email:
50
50
  - tagliala.dev@gmail.com
51
51
  - bcardarella@gmail.com
@@ -110,7 +110,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
110
110
  - !ruby/object:Gem::Version
111
111
  version: '0'
112
112
  requirements: []
113
- rubygems_version: 3.4.19
113
+ rubygems_version: 3.5.9
114
114
  signing_key:
115
115
  specification_version: 4
116
116
  summary: Client Side Validations