edgarj 0.01.27 → 0.01.28

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e6af6ab6ec407b632cd5c3de8af5d1d98e73d493
4
- data.tar.gz: 1d28796fbafe41afcd8b0a5d66e06130dd496f99
3
+ metadata.gz: b07fcbedcd0df4c22c660f933fba2590eb6dc4af
4
+ data.tar.gz: eaca5c7d1c8a36c004a45f177ca061a153d1a451
5
5
  SHA512:
6
- metadata.gz: a043d93250f226f6d8ea2c13d032351b744b54d72db5e923f38ebd31fdf3cc290a13ecdea64c3669c052df7cb3f4d0abafd31f8560e072f8c28f57d9fb142e0d
7
- data.tar.gz: b101146580ec426101ba42731d8115e1179b8f2f9fe03ad5d9f89cdf10cd0c2548b77d032a779faa380cbff97cb8b675bb1e6834dc07a6d8915bd3d82626c032
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
- def column_label(col)
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(col.name,
51
+ I18n.t(col_name,
43
52
  scope: "view.#{controller_path}.#{@controller_model.name.underscore}",
44
- default: @controller_model.human_attribute_name(col.name))
53
+ default: @controller_model.human_attribute_name(col_name))
45
54
  end
46
55
  end
47
56
  end
@@ -1,3 +1,3 @@
1
1
  module Edgarj
2
- VERSION = "0.01.27"
2
+ VERSION = "0.01.28"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: edgarj
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.01.27
4
+ version: 0.01.28
5
5
  platform: ruby
6
6
  authors:
7
7
  - Fuminori Ido