Skip to content
Browse files

Check for to_str rather than String

  • Loading branch information...
1 parent f5b4a9d commit 5cef0cbad2d1df013c74ab96c16cf7fd84040f46 @jeremy jeremy committed Apr 26, 2009
Showing with 1 addition and 1 deletion.
  1. +1 −1 actionpack/lib/action_controller/base/render.rb
View
2 actionpack/lib/action_controller/base/render.rb
@@ -254,7 +254,7 @@ def render(options = nil, extra_options = {}, &block) #:doc:
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)

0 comments on commit 5cef0cb

Please sign in to comment.
Something went wrong with that request. Please try again.