effective_resources 1.3.8 → 1.3.9
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/models/effective/resources/forms.rb +7 -4
- data/lib/effective_resources/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9601649bc492726de56097e2cdf2a77b19a7d7070dcfeafdec34d3f625ba14a7
|
4
|
+
data.tar.gz: b578e2e31a8ef4bd59f20a94f382b9308585f5127af900a018fce7cfe35759fb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 231ad4e9b5088ec45c737a2eded525e7ffe7bbe3423cd12e05a914ae16a36dd9d086a14dc797bd1be0be1bf73edb140d55c2b13380a1d752f37cfdedfbef2d6e
|
7
|
+
data.tar.gz: 995a1e8c968f2c3e6d090cb6a808915d6140d27c18d98cc18ecef449b761dd8dc124a9e348f1b9e6ff2ccb660813b5b2c7cdb1ae87e9e6a3536db05dbcd8bfcb
|
@@ -11,11 +11,14 @@ module Effective
|
|
11
11
|
constant_pluralized = name.to_s.upcase
|
12
12
|
constant = name.to_s.pluralize.upcase
|
13
13
|
|
14
|
-
collection =
|
15
|
-
collection ||= (klass.const_get(constant_pluralized) rescue nil) if defined?("#{klass.name}::#{constant_pluralized}")
|
16
|
-
collection ||= {}
|
14
|
+
collection = nil
|
17
15
|
|
18
|
-
|
16
|
+
if klass.respond_to?(:name)
|
17
|
+
collection ||= (klass.const_get(constant) rescue nil) if defined?("#{klass.name}::#{constant}")
|
18
|
+
collection ||= (klass.const_get(constant_pluralized) rescue nil) if defined?("#{klass.name}::#{constant_pluralized}")
|
19
|
+
end
|
20
|
+
|
21
|
+
{ as: :select, polymorphic: true, collection: collection }.compact
|
19
22
|
when :has_and_belongs_to_many
|
20
23
|
{ as: :select }.merge(search_form_field_collection(has_and_belongs_to_many(name)))
|
21
24
|
when :has_many
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: effective_resources
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.3.
|
4
|
+
version: 1.3.9
|
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: 2019-07-
|
11
|
+
date: 2019-07-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|