aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_dispatch
diff options
context:
space:
mode:
authorlest <just.lest@gmail.com>2011-12-21 15:03:35 +0300
committerlest <just.lest@gmail.com>2011-12-21 15:03:35 +0300
commit127d2c82996dffef088d14c6f5f9af6e66c20820 (patch)
tree5e9e5c23f80a97dffee0e8fd0aa1611095b1c04f /actionpack/lib/action_dispatch
parent893d38d7fde27b52f2b92579a1db59dc1e5e5a07 (diff)
downloadrails-127d2c82996dffef088d14c6f5f9af6e66c20820.tar.gz
rails-127d2c82996dffef088d14c6f5f9af6e66c20820.tar.bz2
rails-127d2c82996dffef088d14c6f5f9af6e66c20820.zip
remove check for string from request body setter
it was required on ruby 1.8
Diffstat (limited to 'actionpack/lib/action_dispatch')
-rw-r--r--actionpack/lib/action_dispatch/http/response.rb9
1 files changed, 1 insertions, 8 deletions
diff --git a/actionpack/lib/action_dispatch/http/response.rb b/actionpack/lib/action_dispatch/http/response.rb
index 5797c63924..84732085f0 100644
--- a/actionpack/lib/action_dispatch/http/response.rb
+++ b/actionpack/lib/action_dispatch/http/response.rb
@@ -121,14 +121,7 @@ module ActionDispatch # :nodoc:
def body=(body)
@blank = true if body == EMPTY
- # Explicitly check for strings. This is *wrong* theoretically
- # but if we don't check this, the performance on string bodies
- # is bad on Ruby 1.8 (because strings responds to each then).
- @body = if body.respond_to?(:to_str) || !body.respond_to?(:each)
- [body]
- else
- body
- end
+ @body = body.respond_to?(:each) ? body : [body]
end
def body_parts