effective_form_inputs 1.2.2 → 1.2.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/models/inputs/effective_select/input.rb +12 -0
- data/lib/effective_form_inputs/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b03aaedcf0c4922442f4beeaabd3c487efc79c86
|
4
|
+
data.tar.gz: 0328e687027e6ad11b2d20d2ff94ef0e7044110d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: dead58136fd0b16bba56980e43202e581760281632f0bf333571e03e9b182626535748a1427d51afcb6f5e1b729b07ca1e8be935b58a24d93e7ca1116f3bc4eb
|
7
|
+
data.tar.gz: 71f0110ebeab045f6b7cad48647052b544b3a811c4bb4ebb6bf174ded67dc6ded60f277df5ac28178931c5ab579a761077ea5d5d0880906b5649e18a44650946
|
@@ -56,6 +56,18 @@ module Inputs
|
|
56
56
|
options[:option_key_method] = :id if options[:option_key_method] == default_options[:option_key_method]
|
57
57
|
end
|
58
58
|
|
59
|
+
if grouped && !options[:polymorphic]
|
60
|
+
if collection[0][1].kind_of?(ActiveRecord::Relation)
|
61
|
+
options[:option_value_method] = :to_s if options[:option_value_method] == default_options[:option_value_method]
|
62
|
+
options[:option_key_method] = :id if options[:option_key_method] == default_options[:option_key_method]
|
63
|
+
end
|
64
|
+
|
65
|
+
if collection[0][1].kind_of?(Array) && !collection[0][1][0].kind_of?(Array)
|
66
|
+
options[:option_value_method] = :to_s if options[:option_value_method] == default_options[:option_value_method]
|
67
|
+
options[:option_key_method] = :to_s if options[:option_key_method] == default_options[:option_key_method]
|
68
|
+
end
|
69
|
+
end
|
70
|
+
|
59
71
|
if grouped
|
60
72
|
collection.each_with_index do |(name, group), index|
|
61
73
|
collection[index][1] = group.respond_to?(:call) ? group.call : group.to_a
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: effective_form_inputs
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.2.
|
4
|
+
version: 1.2.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Code and Effect
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-
|
11
|
+
date: 2018-06-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|