diff options
author | Jeremy Kemper <jeremy@bitsweat.net> | 2009-04-26 19:08:04 -0700 |
---|---|---|
committer | Jeremy Kemper <jeremy@bitsweat.net> | 2009-04-26 19:08:04 -0700 |
commit | 5cef0cbad2d1df013c74ab96c16cf7fd84040f46 (patch) | |
tree | 588f0a9eeed82e84a722882e1782da9ffb031061 /actionpack/lib/action_controller/base | |
parent | f5b4a9d02bc2292bae59e7b4fc028cce6edb91f7 (diff) | |
download | rails-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')
-rw-r--r-- | actionpack/lib/action_controller/base/render.rb | 2 |
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) |