Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions lib/userializer/composite_serializer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,10 @@ def compose_objs(objs)
objs.map do |(key, obj)|
opts = options_for(key)

if obj.is_a? Array
ArraySerializer.new(obj, opts)
else
if obj.is_a?(Hash) || !obj.is_a?(Enumerable)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think should wrap most of the cases, but if we have a Nil class passed here, it will jump inside of this if.
Should we consider this scenario?

Copy link
Contributor Author

@FlorianRichardUPF FlorianRichardUPF Jul 16, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it is the same behaviour as before. There was an else that would catch everything else including Nil class.

CompositeObject.new(obj, opts)
else
ArraySerializer.new(obj, opts)
end
end
end
Expand Down