Skip to content

Sequel gem compatibility #229

@trueinviso

Description

@trueinviso

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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions