We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
respond_to?(:each)
respond_to?(:to_ary)
1 parent 8fa349b commit 208eba3Copy full SHA for 208eba3
lib/jsonapi/renderer/document.rb
@@ -38,7 +38,7 @@ def data_hash
38
primary, included =
39
ResourcesProcessor.new(Array(@data), @include, @fields).process
40
{}.tap do |hash|
41
- hash[:data] = @data.respond_to?(:each) ? primary : primary[0]
+ hash[:data] = @data.respond_to?(:to_ary) ? primary : primary[0]
42
hash[:included] = included if included.any?
43
end
44
0 commit comments