active_admin_simple_life 0.0.13 → 0.0.14

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: 1550b962b4eea85cd019ab7544b96c2bbe652b58
4
- data.tar.gz: 88f45773790edb6cbcb8b3faf8ba9774f5f97049
3
+ metadata.gz: ec370d39c1fce84d4b123e3982d8580b7661ce49
4
+ data.tar.gz: 6c07a7aa138f48521a33ccb1355d5db513ae44d2
5
5
  SHA512:
6
- metadata.gz: de7504236dce23a6df326244a7e07ef270a6d33006a440110421412a1f426a67de5e10a4648eb72df7a953497f22cb1ec2e58fe1ec0ec40b328b3bb66027954e
7
- data.tar.gz: a5d7414ff04a824c48ffb054d3f2754851c780d1002e29a31a7eb6eed7f75782dd73e6d7af33dc3261395ae5dac2046027407619468a7c6cad5f207cdf6f980d
6
+ metadata.gz: 1665c975a59f4f4193af1fe98351d15e93739e7ca1a922fc56c00fc2111bf5dd852cc89c49fa95c08e9d619c9e376617dff3ee0ea9052c1294b04945abd3dc5d
7
+ data.tar.gz: 1487d207ab79a3b19ddc455a357ecdb1fe9b35f3581a180bbf3d5a552405fcbfbad03ac641f58de7f35a0a79fb72ab2b511b4c10a6aaf5993acc72e800bd2160
data/README.md CHANGED
@@ -53,6 +53,7 @@ Parts of `simple_menu_for` may be used for other purposes with:
53
53
  * `index_for_main_fields klass, options`, where options are:
54
54
  1. `:max_length` - max length of field. Integer
55
55
  2. `:add` - extra fields, which will be added in index. Symbol or Array
56
+ 3. `:position` - extra fields starting position (from 0)
56
57
  * `filter_for_main_fields klass`
57
58
  * `form_for_main_fields klass`
58
59
 
@@ -3,11 +3,12 @@ module ActiveAdminSimpleLife
3
3
  module SimpleElements
4
4
  def index_for_main_fields(klass, options = {})
5
5
  max_length = options[:max_length]
6
- add_fields = [options[:add]].flatten.compact
6
+ add_fields = [options[:add]].flatten.compact
7
+ position = options[:position]
7
8
  index download_links: false do
8
9
  selectable_column
9
10
  id_column
10
- klass.main_fields.concat(add_fields).each do |symbol|
11
+ klass.main_fields.insert(position, *add_fields).each do |symbol|
11
12
  column(I18n.t("activerecord.attributes.#{klass.to_s.underscore}.#{symbol}"), sortable: symbol) do |current|
12
13
  field_value = current.send(symbol.cut_id)
13
14
  case field_value
@@ -1,4 +1,4 @@
1
1
  # frozen_string_literal: true
2
2
  module ActiveAdminSimpleLife
3
- VERSION = "0.0.13"
3
+ VERSION = "0.0.14"
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.13
4
+ version: 0.0.14
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kvokka
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-05-26 00:00:00.000000000 Z
11
+ date: 2016-05-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails