If an app is using the Sequel gem as their ORM adapter, a model instance will have each defined on it, for the purpose of iterating all values on that particular instance.
This will prevent the serialization of model instances when FastJsonapi::ObjectSerializer calls is_collection? here, from the serializable_hash method.
def is_collection?(resource)
resource.respond_to?(:each) && !resource.respond_to?(:each_pair)
end
Perhaps size would also achieve the same effect here?
resource.respond_to?(:size) && !resource.respond_to?(:each_pair)
If an app is using the Sequel gem as their ORM adapter, a model instance will have
eachdefined on it, for the purpose of iterating all values on that particular instance.This will prevent the serialization of model instances when
FastJsonapi::ObjectSerializercallsis_collection?here, from theserializable_hashmethod.Perhaps
sizewould also achieve the same effect here?resource.respond_to?(:size) && !resource.respond_to?(:each_pair)