active_admin_simple_life 0.0.6 → 0.0.7

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: 8e22a5b8a9aacc78ab7a9c9e0f159a616810cb20
4
- data.tar.gz: 207b4cb949e2bb51abb1a1ac72bc53b2579c704f
3
+ metadata.gz: 505eb61a93bea44261d4c9409670ea93d89d37a9
4
+ data.tar.gz: e44b26a3ef3c868d94fbb574cc8c1dc7486c2c3b
5
5
  SHA512:
6
- metadata.gz: 53d43865496c3da5afa8bf352e106fa36679be4bfa7f85f2906a2693740dd77a66ea36f827be8926575f8d896a41ef2fb3180547325877453a5471fd856774d3
7
- data.tar.gz: 1a95d47d7efae1f086d217fa4e4367eae560fa028662bca820d6ec9fb820b9726f2475d9d1c45f4a8a725095f3cc270cd4bae968e732b2a14758db7ccab14c7b
6
+ metadata.gz: 8977c001b6cce3653480bb57e52339a080bc26cfde5edbb6864296f9a20c76f257bb9d26d4e0fad5d7e0bd32f3cfdad7c0eb6496938ef199bb3e11408905a6f7
7
+ data.tar.gz: cadf7c2231a6568e6e077ae52ba1c932f8ee85882eeedf2a25b4733d170cab390d7cf29ca1abe4b674414120157d1c7a5439e7bc2aa0e8b9307dcf7319b66a14
data/README.md CHANGED
@@ -64,6 +64,8 @@ so, you may like it. For installation run
64
64
 
65
65
  `rails g active_admin_simple_life:simple_config`
66
66
 
67
+ * For :gender field in filers provided 'male' and 'female' names instead of yes/no
68
+
67
69
  ###I18n
68
70
 
69
71
  For boolean data only
@@ -2,3 +2,7 @@ en:
2
2
  boolean:
3
3
  active: 'Active'
4
4
  not_active: 'Not active'
5
+ active_admin:
6
+ genders:
7
+ male: 'Man'
8
+ female: 'Woman'
@@ -2,3 +2,7 @@ ru:
2
2
  boolean:
3
3
  active: 'Да'
4
4
  not_active: 'Нет'
5
+ active_admin:
6
+ genders:
7
+ male: 'Мужчина'
8
+ female: 'Женщина'
@@ -28,8 +28,15 @@ module ActiveAdminSimpleLife
28
28
  end
29
29
  end
30
30
 
31
+ # it check only for gender field for now
31
32
  def filter_for_main_fields(klass)
32
- klass.main_fields.each { |f| filter f.cut_id }
33
+ klass.main_fields.each do |f|
34
+ if f == :gender
35
+ filter f.cut_id, collection: genders
36
+ else
37
+ filter f.cut_id
38
+ end
39
+ end
33
40
  end
34
41
 
35
42
  def form_for_main_fields(klass, &block)
@@ -78,5 +85,10 @@ module ActiveAdminSimpleLife
78
85
  def span_false
79
86
  Arbre::Context.new { span(class: "status_tag no") { I18n.t "boolean.disactive" } }
80
87
  end
88
+
89
+ def genders
90
+ [[I18n.t("active_admin.genders.male"), true],
91
+ [I18n.t("active_admin.genders.female"), false]]
92
+ end
81
93
  end
82
94
  end
@@ -1,4 +1,4 @@
1
1
  # frozen_string_literal: true
2
2
  module ActiveAdminSimpleLife
3
- VERSION = "0.0.6"
3
+ VERSION = "0.0.7"
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.6
4
+ version: 0.0.7
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-19 00:00:00.000000000 Z
11
+ date: 2016-04-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails