activerecord-bixformer 0.3.15 → 0.3.16
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/activerecord-bixformer/error.rb +2 -8
- data/lib/activerecord-bixformer/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6f547ae90489b5f2aef0914a5730dffce3354399
|
4
|
+
data.tar.gz: 797acc403c81992e1f5f3b5a886ec3dbabf25e10
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7b899f99643b000fa4c6c70eee259706db52cf1884f0c799a4b9c4cf790711ff71c533db1e6b1818f6e5a3cc2a0afc9c3fe3ac80c0bfcf9982a6f8bcda84ed22
|
7
|
+
data.tar.gz: 929768ac1b7fc4795b3c27755d75ab5892594ff5e6b929db64bdb396b19a8f79568c85832caa168829ad1beda774e796486e36b55dfe15410696a96a1d7e9a3f
|
@@ -22,19 +22,13 @@ module ActiveRecord
|
|
22
22
|
|
23
23
|
class AttributeError < ::StandardError
|
24
24
|
def initialize(attribute, value, type)
|
25
|
-
@attribute = attribute
|
25
|
+
@attribute = attribute.model.translate(attribute.name)
|
26
26
|
|
27
27
|
super(generate_message(attribute, type, value))
|
28
28
|
end
|
29
29
|
|
30
30
|
def full_message
|
31
|
-
|
32
|
-
default: "%{attribute} %{message}",
|
33
|
-
attribute: @attribute.model.translate(@attribute.name),
|
34
|
-
message: message
|
35
|
-
}
|
36
|
-
|
37
|
-
I18n.t(:"errors.format", options)
|
31
|
+
I18n.t(:"errors.format", default: "%{attribute} %{message}", attribute: @attribute, message: message)
|
38
32
|
end
|
39
33
|
|
40
34
|
private
|