We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hello!
I'm trying to serialize my product object but it responds to size, so it is treated as a collection in:
size
def is_collection?(resource, force_is_collection = nil) return force_is_collection unless force_is_collection.nil? resource.respond_to?(:size) && !resource.respond_to?(:each_pair) end
and ends up breaking the code:
[1] pry(#<Api::V1::ProductsController>)> ProductSerializer.new(@product).serializable_hash NoMethodError: undefined method `each' for #<Product:0x00007f8f563881b8>
It is intended to be that way?
Workaround:
ProductSerializer.new(@product, is_collection: false).serializable_hash
Thanks!
The text was updated successfully, but these errors were encountered:
This is now merged in the forked project!
Sorry, something went wrong.
Nice, I'll close the issue!
No branches or pull requests
Hello!
I'm trying to serialize my product object but it responds to
size
, so it is treated as a collection in:and ends up breaking the code:
It is intended to be that way?
Workaround:
Thanks!
The text was updated successfully, but these errors were encountered: