active_admin_simple_life 0.1.1 → 0.1.2

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: 6b6e35bdcd085fc37e07533d81d765b02594a18b
4
- data.tar.gz: 2bba9c3d10dba1798423ee89ce68d029176aa829
3
+ metadata.gz: 059f403f8012aa9bd4e592258b2b1c6995a7f90c
4
+ data.tar.gz: f32438e38df93cc3af33bb9ce3a1d0ea297a970f
5
5
  SHA512:
6
- metadata.gz: 6f0555775171dd4f8e041ee252dfc524be4cf00d52225f110c9bbdf9b0760f50758eb3985398b2789652f85ecb0348cb643ca8b3e039990fe712ec4f46aebf47
7
- data.tar.gz: 85816ccfd0ef771e0deab49d73b9903d7bf94cc97896b7c702674cc9d859b7aea2d947cd7165d431047c6d52d7f5c85bea42f71e7a41c02ffc6091e5037b96ff
6
+ metadata.gz: f5484452ccff07d5ef7cfb6bfd78f27dfbbd6d7a50ee6f8a0a03e5a727fdb42a2a7568e1837c7d2daf42326c5b911563f0107158f146a2597a9103618393e3c0
7
+ data.tar.gz: 85d6fc4452715f18a68c10d9d28482383efdb6dcc4a81dd8d8e4511fe1874ce14d11e37d9766f51c44faa35d4b31bb3d8450812536c50152bc87eb5c2446f5df
@@ -12,6 +12,7 @@ module ActiveAdminSimpleLife
12
12
  id_column
13
13
  klass.main_fields.insert(position, *add_fields).each do |symbol|
14
14
  column(I18n.t("activerecord.attributes.#{klass.to_s.underscore}.#{symbol}"), sortable: symbol) do |current|
15
+ plural_symbol = symbol.to_s.pluralize
15
16
  field_value = current.send(ExtensionedSymbol.new(symbol).cut_id)
16
17
  case field_value
17
18
  when ActiveRecord::Base
@@ -24,7 +25,11 @@ module ActiveAdminSimpleLife
24
25
  when FalseClass
25
26
  span_false
26
27
  else
27
- truncate_field field_value.to_s, max_length
28
+ if klass.respond_to?(plural_symbol)
29
+ field_value && I18n.t("activerecord.attributes.#{klass.underscore}.#{plural_symbol}.#{field_value}")
30
+ else
31
+ truncate_field field_value.to_s, max_length
32
+ end
28
33
  end
29
34
  end
30
35
  end
@@ -1,4 +1,4 @@
1
1
  # frozen_string_literal: true
2
2
  module ActiveAdminSimpleLife
3
- VERSION = "0.1.1"
3
+ VERSION = "0.1.2"
4
4
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: active_admin_simple_life
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kvokka
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-06-14 00:00:00.000000000 Z
11
+ date: 2016-06-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails