-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Open
Description
Consider an STI case with only parent class serializers and no separate child serializers. Now throw in different namespaces.
With model's:
class Parent < ActiveRecord::Base
end
class ChildA < Parent
end
class ChildB < Parent
end
Controllers & Serializers with namespaces looks like:
app/controllers/v1/parents_controller.rb
app/serializers/v1/parents_serializer.rb
Expected behavior vs actual behavior
Now when I render child records's from my V1::ParentsController
controller, no serializer is being used (ActiveModel::Serializer::Null
).
I've tracked down the issue to get_serializer_for
method in ActiveModel::Serializer
. When recursively calling get_serializer_for
for super_class
. Here, the namespace needs to be passed in as well.
Environment
Rails: 5
AMS Version: 1.10-stable
Additonal helpful information
Seems to be introduced in b29395b
uhrohraggy, cpm and typeoneerror
Metadata
Metadata
Assignees
Labels
No labels