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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4cf8ae26898f4a8e0494dd73c9710c63bbf1b44e
|
4
|
+
data.tar.gz: a8e8dc8fa09a5df54a53b6ddcc249a51703af315
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
14
|
-
truncate_field
|
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
|
-
|
23
|
+
truncate_field field_value.to_s, max_length
|
23
24
|
end
|
24
25
|
end
|
25
26
|
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
|
+
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-
|
11
|
+
date: 2016-04-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|