lib/panko/response.rb in panko_serializer-0.3.5 vs lib/panko/response.rb in panko_serializer-0.3.6
- old
+ new
@@ -17,15 +17,19 @@
writer = Oj::StringWriter.new(mode: :rails)
writer.push_object
@data.each do |key, value|
- if value.is_a?(Panko::ArraySerializer) || value.is_a?(Panko::Serializer)
- writer.push_json(value.to_json, key.to_s)
+ key = key.to_s
+
+ if value.is_a?(Panko::ArraySerializer) ||
+ value.is_a?(Panko::Serializer) ||
+ value.is_a?(Panko::Response)
+ writer.push_json(value.to_json, key)
elsif value.is_a?(Panko::JsonValue)
- writer.push_json(value.value, key.to_s)
+ writer.push_json(value.value, key)
else
- writer.push_value(value, key.to_s)
+ writer.push_value(value, key)
end
end
writer.pop