active_admin_simple_life 0.0.8 → 0.0.9

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: 690e58efb7e90d6bd25936ade00e1e9640da00f9
4
- data.tar.gz: 6f835b9acb6ed0519a52739d0c948ea53a4161dc
3
+ metadata.gz: 9f28c4f3a3c512bf8c10f9f6a65af502cae770ef
4
+ data.tar.gz: a9b945a1b6698444d3475600a9f9cedb85abfa20
5
5
  SHA512:
6
- metadata.gz: 1cadb3fd8ac45225f61c371bbbfe39357cf40d4e750f275fb78b16d76e51126a4b48eddd64d79e242c4436f316bbb4add586606dc35c29e0eb6ee7e0bb9a18af
7
- data.tar.gz: 1257168eb6d61ce1a95df9ac4c400b15c46fde9f28bd649762454fd8d35e534a330e3fb76c819f56a674c7f53200991c977036f55b68f56e47dd1928a327ed26
6
+ metadata.gz: dab140aa15d768bca97e228ad74ab3f5b426e4f622c842994c20334a6f726a5b16a27a6b982c8da718c56473c84379416dce0b293c25427e07059d2bcab75438
7
+ data.tar.gz: b412441e86bdb3e5357151e094f847a31cd7275809c48f0faa5c1df3e1abe2add453dad8d014ed4e4bb14c790a9bf692d65759b344df4e3f980b30ef418add10
@@ -43,7 +43,14 @@ module ActiveAdminSimpleLife
43
43
  form do |f|
44
44
  f.semantic_errors(*f.object.errors.keys)
45
45
  f.inputs do
46
- klass.main_fields.each { |ff| f.input ff.cut_id }
46
+ klass.main_fields.each do |ff|
47
+ ff_cut_id = ff.cut_id
48
+ if collection? ff
49
+ f.input ff_cut_id, as: :select, member_label: :to_s
50
+ else
51
+ f.input ff_cut_id
52
+ end
53
+ end
47
54
  f.instance_eval(&block) if block_given?
48
55
  end
49
56
  f.actions
@@ -78,12 +85,17 @@ module ActiveAdminSimpleLife
78
85
  "edit_admin_#{field.class.to_s.underscore}_path"
79
86
  end
80
87
 
88
+ def collection?(symbol)
89
+ true if symbol.to_s =~ /_id$/
90
+ false
91
+ end
92
+
81
93
  def span_true
82
94
  Arbre::Context.new { span(class: "status_tag yes") { I18n.t("boolean.active") } }
83
95
  end
84
96
 
85
97
  def span_false
86
- Arbre::Context.new { span(class: "status_tag no") { I18n.t "boolean.not_active" } }
98
+ Arbre::Context.new { span(class: "status_tag no") { I18n.t "boolean.disactive" } }
87
99
  end
88
100
 
89
101
  def genders
@@ -1,4 +1,4 @@
1
1
  # frozen_string_literal: true
2
2
  module ActiveAdminSimpleLife
3
- VERSION = "0.0.8"
3
+ VERSION = "0.0.9"
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.8
4
+ version: 0.0.9
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-25 00:00:00.000000000 Z
11
+ date: 2016-05-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails