diff --git a/lib/action_controller/serialization.rb b/lib/action_controller/serialization.rb index 7ff06950d..df23aa956 100644 --- a/lib/action_controller/serialization.rb +++ b/lib/action_controller/serialization.rb @@ -45,13 +45,15 @@ def serialization_scope(scope) end end - def _render_option_json(resource, options) - serializer = build_json_serializer(resource, options) - - if serializer - super(serializer, options) - else - super + [:_render_option_json, :_render_with_renderer_json].each do |renderer_method| + define_method renderer_method do |resource, options| + serializer = build_json_serializer(resource, options) + + if serializer + super(serializer, options) + else + super(resource, options) + end end end