-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
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
CollectionSerializer does not work when serializer is namespaced #2030
Comments
Could you note why you closed this? |
I used |
thanks for sharing back! did you find it in the docs? Just interested in your debugging path. |
@kapso I also recommend that you do not use the collection serializer directly. That's not how AMS is designed to be used. |
@bf4 I had dig into the code for this. I am trying to upgrade from Lot of our serializers are namespaced, for e.g. This used to work in @users = User.active # or User.active.to_a
render json: @users, serializer: Admin::UserSerializer, root: true So I am forced to use render json: {
users: ActiveModel::Serializer::CollectionSerializer.new(@users, serializer: Admin::UserSerializer)
} |
Some related issues C: Upgrading |
Collection serializer does not work when serializer is namespaced inside a module.
So in the following case, it always defaults to just
UserSerializer
and notAdmin::UserSerializer
The text was updated successfully, but these errors were encountered: