aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_controller
diff options
context:
space:
mode:
authorJosé Valim <jose.valim@gmail.com>2011-11-23 23:45:27 +0000
committerJosé Valim <jose.valim@gmail.com>2011-11-23 23:45:27 +0000
commit7fcc8c0a1f38c77b12cb6ffe81fb2887e6c60b85 (patch)
treeac081db672326a11910e9c46d93c9675c83c2e87 /actionpack/lib/action_controller
parent6da52c617e2a075b9d9e7142786f316d8f2c7930 (diff)
downloadrails-7fcc8c0a1f38c77b12cb6ffe81fb2887e6c60b85.tar.gz
rails-7fcc8c0a1f38c77b12cb6ffe81fb2887e6c60b85.tar.bz2
rails-7fcc8c0a1f38c77b12cb6ffe81fb2887e6c60b85.zip
Rely solely on active_model_serializer and remove the fancy constant lookup.
Diffstat (limited to 'actionpack/lib/action_controller')
-rw-r--r--actionpack/lib/action_controller/metal/serialization.rb4
1 files changed, 3 insertions, 1 deletions
diff --git a/actionpack/lib/action_controller/metal/serialization.rb b/actionpack/lib/action_controller/metal/serialization.rb
index 9bb665a9ae..9fb49f512e 100644
--- a/actionpack/lib/action_controller/metal/serialization.rb
+++ b/actionpack/lib/action_controller/metal/serialization.rb
@@ -13,7 +13,9 @@ module ActionController
end
def _render_option_json(json, options)
- json = json.active_model_serializer.new(json, serialization_scope) if json.respond_to?(:active_model_serializer)
+ if json.respond_to?(:active_model_serializer) && (serializer = json.active_model_serializer)
+ json = serializer.new(json, serialization_scope)
+ end
super
end