active_admin_simple_life 0.0.4 → 0.0.5

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: 4e52254ca55eb36f272b62149d6e9d17fc519063
4
- data.tar.gz: d26d81b3872e8aeee8bc6fd89d4927878bb7df41
3
+ metadata.gz: 4cf8ae26898f4a8e0494dd73c9710c63bbf1b44e
4
+ data.tar.gz: a8e8dc8fa09a5df54a53b6ddcc249a51703af315
5
5
  SHA512:
6
- metadata.gz: 6b1784629a4441cbffc5639725ec3413ea887a654420380537ab106d43506c1b3a6153c1dad6a2ae68c49724497a8008955befa61367880a220a80e3f328331e
7
- data.tar.gz: f424149c68e08766a8f4bbc97b781b79d556e4554233f3f1a2d9b73dd38bb5ce097a5db17455a5188e7a62aa6718e3d6cb1478286cbe81924ac9715c3af5f9f9
6
+ metadata.gz: 4e30653d0a82628e232ca5af76c9cd3f3e99991a20ae6949fac3d9226f0131bb6b978ba7740214b16005394a956e845a2e97b8a9d5d3e2083944b09cdbc1eda4
7
+ data.tar.gz: 93ad99128e47f9c9b831ed9f807f6748e72c848f98ed3943744c227d5fe566ae1ffb2aa018d1451befbcd2c78553c4361d92cc886c7082b3b83ed8ba3095f197
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
  module ActiveAdminSimpleLife
3
3
  module SimpleElements
4
- def index_for_main_fields(klass, options={})
4
+ def index_for_main_fields(klass, options = {})
5
5
  max_length = options[:max_length]
6
6
  index download_links: false do
7
7
  selectable_column
@@ -10,8 +10,9 @@ module ActiveAdminSimpleLife
10
10
  column(I18n.t("activerecord.attributes.#{klass.to_s.underscore}.#{symbol}"), sortable: symbol) do |current|
11
11
  field_value = current.send(symbol.cut_id)
12
12
  case field_value
13
- when String
14
- truncate_field field_value, max_length
13
+ when ActiveRecord::Base
14
+ link_to truncate_field(field_value, max_length),
15
+ send(fetch_path(field_value), field_value.id)
15
16
  when ::ActiveSupport::TimeWithZone, Time, Date
16
17
  I18n.l field_value, format: :long
17
18
  when TrueClass
@@ -19,7 +20,7 @@ module ActiveAdminSimpleLife
19
20
  when FalseClass
20
21
  span_false
21
22
  else
22
- link_to truncate_field(field_value, max_length), send(fetch_path(field_value), field_value.id)
23
+ truncate_field field_value.to_s, max_length
23
24
  end
24
25
  end
25
26
  end
@@ -1,4 +1,4 @@
1
1
  # frozen_string_literal: true
2
2
  module ActiveAdminSimpleLife
3
- VERSION = "0.0.4"
3
+ VERSION = "0.0.5"
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.0.4
4
+ version: 0.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kvokka
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-04-17 00:00:00.000000000 Z
11
+ date: 2016-04-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails