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 committed Oct 9, 2014
1 parent 5acd98e commit 447d969
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 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)

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

Expand Down

0 comments on commit 447d969

Please sign in to comment.