New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support Rails 4.2.0 #675

Merged
merged 1 commit into from Oct 9, 2014
Jump to file or symbol
Failed to load files and symbols.
+11 −9
Diff settings

Always

Just for now

@@ -6,17 +6,19 @@ module Serialization
include ActionController::Renderers
def _render_option_json(resource, options)
serializer = ActiveModel::Serializer.serializer_for(resource)
[:_render_option_json, :_render_with_renderer_json].each do |renderer_method|
define_method renderer_method do |resource, options|
serializer = ActiveModel::Serializer.serializer_for(resource)
if serializer
# omg hax
object = serializer.new(resource)
adapter = ActiveModel::Serializer.adapter.new(object)
if serializer
# omg hax
object = serializer.new(resource)
adapter = ActiveModel::Serializer.adapter.new(object)
super(adapter, options)
else
super
super(adapter, options)
else
super(resource, options)
end
end
end
end
ProTip! Use n and p to navigate between commits in a pull request.