effective_resources 1.0.18 → 1.0.19

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: c6697c99d320db2f280de074fa71b76c094752b6
4
- data.tar.gz: 5a76782f89645f9f7c446545ec9a7b5acde78a95
3
+ metadata.gz: 2d1f8af977978cf1bb45d0cc6a737396cba17f55
4
+ data.tar.gz: b57662a6e2e9934e8824b1b1f9a3d209eaeef8d6
5
5
  SHA512:
6
- metadata.gz: 4b70d6341d742bf156ba2d11e7bcad49c1f696d8383782354edd7b00305e3cc4f1b5b711da75d4819712952e6a5b395be9b18a59710088335163ad531f64c4fd
7
- data.tar.gz: 84c200a53aee28c0d79f91b6e047431a0689207b7674c468c7d8addc946be057358981e0d04d8375575f937f313ca15b9ab866dd0013a7b005e032f904b9d861
6
+ metadata.gz: 63bd096d0c815c10a817790ff5245ef946e41cb4b1beec69d3f9eb2461a79824867e46a8267efa44a043a8e337002e9323badf0dd5102d82c508b6cc831d63bf
7
+ data.tar.gz: d240fa175ec01452e98214ad4e28dc2ee2fef2f43ed74349520ab7268546192e95c435c005e977d8faa66b3ad133ffea97ebf11d38834336cf54664568b35e7b
@@ -11,13 +11,11 @@ module Effective
11
11
  constant_pluralized = name.to_s.upcase
12
12
  constant = name.to_s.pluralize.upcase
13
13
 
14
- if defined?("#{klass.name}::#{constant}")
15
- { as: :select, polymorphic: true, collection: klass.const_get(constant) }
16
- elsif defined?("#{klass.name}::#{constant_pluralized}")
17
- { as: :select, polymorphic: true, collection: klass.const_get(constant_pluralized) }
18
- else
19
- { as: :string }
20
- end
14
+ collection = (klass.const_get(constant) rescue nil) if defined?("#{klass.name}::#{constant}")
15
+ collection ||= (klass.const_get(constant_pluralized) rescue nil) if defined?("#{klass.name}::#{constant_pluralized}")
16
+ collection ||= {}
17
+
18
+ { as: :select, polymorphic: true, collection: collection }
21
19
  when :has_and_belongs_to_many
22
20
  { as: :select }.merge(search_form_field_collection(has_and_belongs_to_many(name)))
23
21
  when :has_many
@@ -1,3 +1,3 @@
1
1
  module EffectiveResources
2
- VERSION = '1.0.18'.freeze
2
+ VERSION = '1.0.19'.freeze
3
3
  end
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.0.18
4
+ version: 1.0.19
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-12-14 00:00:00.000000000 Z
11
+ date: 2018-12-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails