client_side_validations 22.1.0 → 22.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/lib/client_side_validations/active_model.rb +18 -1
- data/lib/client_side_validations/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 98b3863f2e2386f76eadb2b85e9d7f927b98c9b678cdce921711a76ed286c4ba
|
4
|
+
data.tar.gz: cd4f16743a959139b498ee519c3f857f4f2f24dfe3fcb0c2b2398640a9bd9131
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 48958aa9ea9fefcd8c7580d2f1fae4b7804b9f0959e72e29985d154280800e25306ff75c207dbd04785d484620a615466eda801de11ca22f003cc9bfc6ff9d0d
|
7
|
+
data.tar.gz: 8294a353659edf7a85ec572cf29b975c5e4c24787ec1b838ab963ae1f44d69ceddc6bfe21bc80b430bf877199e364ffedd6b0416ce0b02124fea478db07a65da
|
data/CHANGELOG.md
CHANGED
@@ -18,7 +18,24 @@ module ClientSideValidations
|
|
18
18
|
private
|
19
19
|
|
20
20
|
def build_client_side_hash(model, attribute, options)
|
21
|
-
|
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
|
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.
|
4
|
+
version: 22.1.1
|
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-
|
12
|
+
date: 2023-10-08 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: js_regex
|