diff options
author | Jeremy Kemper <jeremy@bitsweat.net> | 2009-04-26 16:04:11 -0700 |
---|---|---|
committer | Jeremy Kemper <jeremy@bitsweat.net> | 2009-04-26 16:04:11 -0700 |
commit | c9d9bd7227b687f2162bd485b891aa2c2499adf0 (patch) | |
tree | 6f2e06a72d59c1b774d312acf1e87b246b2cf233 /actionpack | |
parent | ea712364e202816ce99f53824f01d0aa6f178247 (diff) | |
download | rails-c9d9bd7227b687f2162bd485b891aa2c2499adf0.tar.gz rails-c9d9bd7227b687f2162bd485b891aa2c2499adf0.tar.bz2 rails-c9d9bd7227b687f2162bd485b891aa2c2499adf0.zip |
Check for to_str rather than String
Diffstat (limited to 'actionpack')
-rw-r--r-- | actionpack/lib/action_dispatch/http/response.rb | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/actionpack/lib/action_dispatch/http/response.rb b/actionpack/lib/action_dispatch/http/response.rb index 77c2dd0d7a..c2add1272e 100644 --- a/actionpack/lib/action_dispatch/http/response.rb +++ b/actionpack/lib/action_dispatch/http/response.rb @@ -98,7 +98,7 @@ module ActionDispatch # :nodoc: def body=(body) @body = - if body.is_a?(String) + if body.respond_to?(:to_str) [body] else body @@ -215,8 +215,6 @@ module ActionDispatch # :nodoc: if @body.respond_to?(:call) @writer = lambda { |x| callback.call(x) } @body.call(self, self) - elsif @body.is_a?(String) - callback.call(@body) else @body.each(&callback) end |