Skip to content

Commit

Permalink
Support Rails 4.2.0 with AMS 0.9
Browse files Browse the repository at this point in the history
This patch is the same fixes as rails-api#655 and rails-api#663 for 0-9-stable branch.
  • Loading branch information
tricknotes authored and plehoux committed Jan 9, 2015
1 parent 97c9c50 commit 43dde4b
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions lib/action_controller/serialization.rb
Original file line number Diff line number Diff line change
Expand Up @@ -45,13 +45,15 @@ def serialization_scope(scope)
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

Expand Down

0 comments on commit 43dde4b

Please sign in to comment.