mirror of
https://github.com/ditkrg/active_model_serializers.git
synced 2026-01-25 07:16:49 +00:00
Fix the bug that serializer could not be found if the association's serializer is namespaced but the model is not
[fix #2295]
This commit is contained in:
@@ -76,6 +76,7 @@ module ActiveModel
|
||||
serializer_options[:serializer_context_class] = association_options.fetch(:parent_serializer).class
|
||||
serializer = reflection_options.fetch(:serializer, nil)
|
||||
serializer_options[:serializer] = serializer if serializer
|
||||
serializer_options[:namespace] = reflection_options[:namespace] if reflection_options[:namespace]
|
||||
serializer_class.new(object, serializer_options)
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user