From 5cef0cbad2d1df013c74ab96c16cf7fd84040f46 Mon Sep 17 00:00:00 2001 From: Jeremy Kemper Date: Sun, 26 Apr 2009 19:08:04 -0700 Subject: Check for to_str rather than String --- actionpack/lib/action_controller/base/render.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'actionpack/lib/action_controller/base/render.rb') diff --git a/actionpack/lib/action_controller/base/render.rb b/actionpack/lib/action_controller/base/render.rb index 33695cd78e..601c5429c3 100644 --- a/actionpack/lib/action_controller/base/render.rb +++ b/actionpack/lib/action_controller/base/render.rb @@ -254,7 +254,7 @@ module ActionController render_for_text(js) elsif json = options[:json] - json = ActiveSupport::JSON.encode(json) unless json.is_a?(String) + json = ActiveSupport::JSON.encode(json) unless json.respond_to?(:to_str) json = "#{options[:callback]}(#{json})" unless options[:callback].blank? response.content_type ||= Mime::JSON render_for_text(json) -- cgit v1.2.3