translated_attribute_value 0.0.3 → 0.0.4
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
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2ced979a2c098e8f55ff2ebdbc99fb6892b7e95e
|
4
|
+
data.tar.gz: 0ca8da525eeaa9dc337d1a52b1b2435bd7ff0c6b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: dfd91b6d63f5735429bb5a002ae22fb81fb0a297d4784fbe8746c91f46b3f505b5ffd6475abd7e8d4a1cc46fb4383672ab7db9d27b3f5df9d614c260cb57fca8
|
7
|
+
data.tar.gz: 589269c6809202a627b2589068db2ae0a27a5a334620f7df9f8415d4e38c19c6a7b3660ada75c568c877eb220696660762e978a64350405e137f92f9259912a0
|
@@ -28,17 +28,17 @@ module TranslatedAttributeValue
|
|
28
28
|
if defined?(ActiveRecord::Base) && self.ancestors.include?(ActiveRecord::Base)
|
29
29
|
self.send(:define_method, "#{attribute_name}_translated") do
|
30
30
|
attribute_value = self.send(attribute_name)
|
31
|
-
I18n.t("activerecord.attributes.#{self.class.to_s.
|
31
|
+
I18n.t("activerecord.attributes.#{self.class.to_s.underscore}.#{attribute_name}_translation.#{attribute_value}")
|
32
32
|
end
|
33
33
|
elsif defined?(Mongoid::Document) && self.ancestors.include?(Mongoid::Document)
|
34
34
|
self.send(:define_method, "#{attribute_name}_translated") do
|
35
35
|
attribute_value = self.send(attribute_name)
|
36
|
-
I18n.t("mongoid.attributes.#{self.class.to_s.
|
36
|
+
I18n.t("mongoid.attributes.#{self.class.to_s.underscore}.#{attribute_name}_translation.#{attribute_value}")
|
37
37
|
end
|
38
38
|
else
|
39
39
|
self.send(:define_method, "#{attribute_name}_translated") do
|
40
40
|
attribute_value = self.send(attribute_name)
|
41
|
-
I18n.t("translated_attribute_value.#{self.class.to_s.
|
41
|
+
I18n.t("translated_attribute_value.#{self.class.to_s.underscore}.#{attribute_name}_translation.#{attribute_value}")
|
42
42
|
end
|
43
43
|
end # of if chain
|
44
44
|
end # of each
|
@@ -18,7 +18,7 @@ describe TranslatedAttributeValue::Base do
|
|
18
18
|
end
|
19
19
|
|
20
20
|
def self.to_s
|
21
|
-
"
|
21
|
+
"NomeClasse"
|
22
22
|
end
|
23
23
|
|
24
24
|
end.new
|
@@ -52,7 +52,7 @@ describe TranslatedAttributeValue::Base do
|
|
52
52
|
end
|
53
53
|
|
54
54
|
def self.to_s
|
55
|
-
"
|
55
|
+
"NomeClasse"
|
56
56
|
end
|
57
57
|
|
58
58
|
end.new
|
@@ -88,7 +88,7 @@ describe TranslatedAttributeValue::Base do
|
|
88
88
|
end
|
89
89
|
|
90
90
|
def self.to_s
|
91
|
-
"
|
91
|
+
"NomeClasse"
|
92
92
|
end
|
93
93
|
|
94
94
|
end.new
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: translated_attribute_value
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Vinícius Oyama
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-06-
|
11
|
+
date: 2014-06-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|