forest_liana 1.3.31 → 1.3.32
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 114ffafc36fa1a865ab38df0933f712dc145f592
|
4
|
+
data.tar.gz: 8682f89e467aa0674c74405f1cedad9645c7b961
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 988750eb9cb5855a687ce295bcf44fbbdaac7a0dfd15715ea99ab85c7eba152c93273f7946f51a22353c1513a40e70fc84cf3dcea829f7a5ef364b68335df2da
|
7
|
+
data.tar.gz: d49507c2646150d78f0b5b0a5290df90f42062a4891807b9a432ed0a2073e3d7f568994b303eafbd9127433e6337b912fd29d54eb5afce885df46666a05c583d
|
@@ -35,7 +35,16 @@ module ForestLiana
|
|
35
35
|
association = @resource.reflect_on_association(name.try(:to_sym))
|
36
36
|
|
37
37
|
if [:has_one, :belongs_to].include?(association.try(:macro))
|
38
|
-
|
38
|
+
# TODO: refactor like this?
|
39
|
+
#if data.blank?
|
40
|
+
#@attributes[name] = nil
|
41
|
+
#else
|
42
|
+
#@attributes[name] = association.klass.find(data[:id])
|
43
|
+
#end
|
44
|
+
|
45
|
+
# ActionController::Parameters do not inherit from Hash anymore
|
46
|
+
# since Rails 5.
|
47
|
+
if (data.is_a?(Hash) || data.is_a?(ActionController::Parameters)) && data[:id]
|
39
48
|
@attributes[name] = association.klass.find(data[:id])
|
40
49
|
elsif data.blank?
|
41
50
|
@attributes[name] = nil
|
data/lib/forest_liana/version.rb
CHANGED