You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hey - might be doing something stupid, but I think I've found a bug in 0.9.0 when specifying a root key for associated child objects, when viewing an array of the parent objects.
serializer=ActiveModel::ArraySerializer.new(users,each_serializer: UserSerializer,root: :users)serializer.to_json# NoMethodError:# undefined method `concat' for #<Hash:0x007fe033555fa8>
I'm using grape so not instantiating ActiveModel::ArraySerializer.new manually, but stumped by the Hash error I went back to IRB to figure out where the error was coming from. As far as I can tell this isolates it to something wrong with my Serializer configuration, but I'm not sure how to take it further and debug what's breaking.
It's not the end of the world, but I'd like to be able to embed sideloaded objects in a linked key if possible!
The text was updated successfully, but these errors were encountered:
Hey - might be doing something stupid, but I think I've found a bug in
0.9.0
when specifying a root key for associated child objects, when viewing an array of the parent objects.grape 0.9.0
grape-active_model_serializers 1.2.1
active_model_serialziers 0.9.0
It works when serializing one object:
it breaks when serializing multiple objects:
I'm using grape so not instantiating
ActiveModel::ArraySerializer.new
manually, but stumped by the Hash error I went back to IRB to figure out where the error was coming from. As far as I can tell this isolates it to something wrong with my Serializer configuration, but I'm not sure how to take it further and debug what's breaking.It's not the end of the world, but I'd like to be able to embed sideloaded objects in a
linked
key if possible!The text was updated successfully, but these errors were encountered: