Support Rails 4.2.0 with AMS 0.9

This patch is the same fixes as #655 and #663 for 0-9-stable branch.
This commit is contained in:
Ryunosuke SATO 2014-10-10 00:53:56 +09:00
parent 5acd98e61b
commit 447d96923f

View File

@ -45,13 +45,15 @@ module ActionController
end
end
def _render_option_json(resource, options)
serializer = build_json_serializer(resource, options)
[:_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
if serializer
super(serializer, options)
else
super(resource, options)
end
end
end