edgarj 0.01.27 → 0.01.28
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/helpers/edgarj/common_helper.rb +12 -3
- data/lib/edgarj/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: b07fcbedcd0df4c22c660f933fba2590eb6dc4af
|
4
|
+
data.tar.gz: eaca5c7d1c8a36c004a45f177ca061a153d1a451
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7130d84cbb8ff5c3b13824eda7cb04fa56d8f52f99923b932be7fcd80f3cc18fd865ca402dfeb755eacd6d42c806306f5d7c4ad6977c114de4d6f2328699b345
|
7
|
+
data.tar.gz: 8ed7677207aa8e4ce1f2d049ba4100207889e499a05dc45fd9658fffbe897b0da2591bfc38b1f78ab6f601b0b7d382c81b53fd57e484dfbcf7af0446403480f6
|
@@ -37,11 +37,20 @@ module Edgarj
|
|
37
37
|
# column label with the following fallback order:
|
38
38
|
# 1. t('view.CONTROLLER.label.MODEL.COLUMN') if exists.
|
39
39
|
# 1. model.human_attribute_name(col.name)
|
40
|
-
|
40
|
+
#
|
41
|
+
# @param col_or_sym [Column, String, or Symbol]
|
42
|
+
def column_label(col_or_sym)
|
43
|
+
col_name =
|
44
|
+
case col_or_sym
|
45
|
+
when String, Symbol
|
46
|
+
col_or_sym
|
47
|
+
else
|
48
|
+
col_or_sym.name
|
49
|
+
end
|
41
50
|
@controller_model ||= controller.send(:model)
|
42
|
-
I18n.t(
|
51
|
+
I18n.t(col_name,
|
43
52
|
scope: "view.#{controller_path}.#{@controller_model.name.underscore}",
|
44
|
-
default: @controller_model.human_attribute_name(
|
53
|
+
default: @controller_model.human_attribute_name(col_name))
|
45
54
|
end
|
46
55
|
end
|
47
56
|
end
|
data/lib/edgarj/version.rb
CHANGED