aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_controller/base/render.rb
diff options
context:
space:
mode:
authorJeremy Kemper <jeremy@bitsweat.net>2009-04-26 19:08:04 -0700
committerJeremy Kemper <jeremy@bitsweat.net>2009-04-26 19:08:04 -0700
commit5cef0cbad2d1df013c74ab96c16cf7fd84040f46 (patch)
tree588f0a9eeed82e84a722882e1782da9ffb031061 /actionpack/lib/action_controller/base/render.rb
parentf5b4a9d02bc2292bae59e7b4fc028cce6edb91f7 (diff)
downloadrails-5cef0cbad2d1df013c74ab96c16cf7fd84040f46.tar.gz
rails-5cef0cbad2d1df013c74ab96c16cf7fd84040f46.tar.bz2
rails-5cef0cbad2d1df013c74ab96c16cf7fd84040f46.zip
Check for to_str rather than String
Diffstat (limited to 'actionpack/lib/action_controller/base/render.rb')
-rw-r--r--actionpack/lib/action_controller/base/render.rb2
1 files changed, 1 insertions, 1 deletions
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)