join_collection 0.0.2 → 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/join_collection.rb +2 -2
- metadata +1 -1
data/lib/join_collection.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
class JoinCollection
|
2
2
|
|
3
|
-
VERSION = "0.0
|
3
|
+
VERSION = "0.1.0"
|
4
4
|
|
5
5
|
attr_reader :source_objects
|
6
6
|
attr_accessor :join_type, :singular_target, :plural_target
|
@@ -74,7 +74,7 @@ class JoinCollection
|
|
74
74
|
when plural_target
|
75
75
|
doc[plural_target] = target_objects if join_type == :join_many
|
76
76
|
else
|
77
|
-
doc["#{singular_target}_#{field}"] = target_object.
|
77
|
+
doc["#{singular_target}_#{field}"] = target_object.try(field)
|
78
78
|
end
|
79
79
|
end
|
80
80
|
end
|