validation_hints 0.2.1 → 0.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +5 -5
- data/lib/active_model/hints.rb +7 -3
- data/lib/validation_hints/version.rb +1 -1
- metadata +3 -4
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
|
-
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
2
|
+
SHA256:
|
|
3
|
+
metadata.gz: 9cf32471d0a80a02b0a5db3b89ba7564d5fa92e00e2e2bcb2e28f04a4b462d04
|
|
4
|
+
data.tar.gz: 044bd3521b06d203e01dc40084cfa1d0cf9e09c52b33be24e1067f7b692cfa77
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: daa31a4cb817fe4cef08124e970d2a5a02c8f6c8350441486f817354e011b3d7bc18690f089da18d31e9443db4ebb7b278433e8280de156f5b6a895514812f1f
|
|
7
|
+
data.tar.gz: 0b2b921d259e537178a4675d787fda8632ae87ed90a7f356e82a47768892802d3ce0f6c99993d6856468e68e986cbd49975267044706ff2c4994dc7e669e93e9
|
data/lib/active_model/hints.rb
CHANGED
|
@@ -278,11 +278,11 @@ module ActiveModel
|
|
|
278
278
|
return message if attribute == :base
|
|
279
279
|
attr_name = attribute.to_s.gsub('.', '_').humanize
|
|
280
280
|
attr_name = @base.class.human_attribute_name(attribute, :default => attr_name)
|
|
281
|
-
I18n.t(:"hints.format",
|
|
281
|
+
I18n.t(:"hints.format",
|
|
282
282
|
:default => "%{attribute} %{message}",
|
|
283
283
|
:attribute => attr_name,
|
|
284
284
|
:message => message
|
|
285
|
-
|
|
285
|
+
)
|
|
286
286
|
end
|
|
287
287
|
|
|
288
288
|
def generate_message(attribute, type, options = {})
|
|
@@ -311,7 +311,11 @@ module ActiveModel
|
|
|
311
311
|
:model => @base.class.model_name.human,
|
|
312
312
|
:attribute => @base.class.human_attribute_name(attribute),
|
|
313
313
|
}.merge(options)
|
|
314
|
-
I18n.translate(key,
|
|
314
|
+
I18n.translate(key,
|
|
315
|
+
:default => defaults,
|
|
316
|
+
:model => @base.class.model_name.human,
|
|
317
|
+
:attribute => @base.class.human_attribute_name(attribute),
|
|
318
|
+
)
|
|
315
319
|
end
|
|
316
320
|
|
|
317
321
|
end
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: validation_hints
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.2.
|
|
4
|
+
version: 0.2.2
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Ace Suares
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date:
|
|
11
|
+
date: 2023-03-28 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: rspec-rails
|
|
@@ -117,8 +117,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
117
117
|
- !ruby/object:Gem::Version
|
|
118
118
|
version: '0'
|
|
119
119
|
requirements: []
|
|
120
|
-
|
|
121
|
-
rubygems_version: 2.4.6
|
|
120
|
+
rubygems_version: 3.2.3
|
|
122
121
|
signing_key:
|
|
123
122
|
specification_version: 4
|
|
124
123
|
summary: Validation Hints.
|