validation_hints 0.2.1 → 0.2.3
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 +13 -8
- 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: 70e978eeafefe43ecdd6e839270b02dcce985559b5e53f74f25f78554c2d7797
|
4
|
+
data.tar.gz: 1bbfb375b4ca43456e823ff30bd0d98ac6719114055276cdafb8f9bb121436d8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 53067b662b9c4db01b83319d0f09bbceb09153f1c63c57e8a64905e858fa1bcdd20dc237a43ef02c36bba69838d30c03bfb717c2528a674b62b118f46895b32a
|
7
|
+
data.tar.gz: bcfa1937c2d921c549375d7a3543f4a7f278f17e9f447e7b67b867a8788561538ed483b8253bf296f1f0fb8733d8e5d195e21db8bf63c756421972827fdde919
|
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 = {})
|
@@ -306,12 +306,17 @@ module ActiveModel
|
|
306
306
|
|
307
307
|
key = defaults.shift
|
308
308
|
|
309
|
-
options = {
|
310
|
-
|
311
|
-
|
312
|
-
|
313
|
-
}.merge(options)
|
314
|
-
I18n.translate(key,
|
309
|
+
# options = {
|
310
|
+
# :default => defaults,
|
311
|
+
# :model => @base.class.model_name.human,
|
312
|
+
# :attribute => @base.class.human_attribute_name(attribute),
|
313
|
+
# }.merge(options)
|
314
|
+
I18n.translate( key,
|
315
|
+
default: defaults,
|
316
|
+
model: @base.class.model_name.human,
|
317
|
+
attribute: @base.class.human_attribute_name(attribute),
|
318
|
+
count: options[:count],
|
319
|
+
)
|
315
320
|
end
|
316
321
|
|
317
322
|
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.3
|
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.
|