Permalink
Browse files

Check for to_str instead of String

  • Loading branch information...
1 parent aebd1ba commit 05abd7c1963758b6e98277ba360072a6308d5d1a @jeremy jeremy committed Jun 9, 2009
Showing with 2 additions and 2 deletions.
  1. +1 −1 actionpack/lib/action_controller/integration.rb
  2. +1 −1 actionpack/lib/action_controller/response.rb
@@ -326,7 +326,7 @@ def process(method, path, parameters = nil, headers = nil)
end
@body = ""
- if body.is_a?(String)
+ if body.respond_to?(:to_str)
@body << body
else
body.each { |part| @body << part }
@@ -151,7 +151,7 @@ def each(&callback)
if @body.respond_to?(:call)
@writer = lambda { |x| callback.call(x) }
@body.call(self, self)
- elsif @body.is_a?(String)
+ elsif @body.respond_to?(:to_str)
yield @body
else
@body.each(&callback)

0 comments on commit 05abd7c

Please sign in to comment.