diff options
author | José Valim <jose.valim@gmail.com> | 2011-12-21 06:46:01 -0800 |
---|---|---|
committer | José Valim <jose.valim@gmail.com> | 2011-12-21 06:46:01 -0800 |
commit | 2ba3d135e375e05b3f114013bc0608d6bcd045a4 (patch) | |
tree | 0507803a8c5936fb40e853c0c651d030e286312e /actionpack/lib/action_dispatch | |
parent | 987ca2ae24226ccfddbcf87e7e1750c7f9cfcaa1 (diff) | |
parent | 127d2c82996dffef088d14c6f5f9af6e66c20820 (diff) | |
download | rails-2ba3d135e375e05b3f114013bc0608d6bcd045a4.tar.gz rails-2ba3d135e375e05b3f114013bc0608d6bcd045a4.tar.bz2 rails-2ba3d135e375e05b3f114013bc0608d6bcd045a4.zip |
Merge pull request #4094 from lest/remove-1-8-code
remove check for string from request body setter
Diffstat (limited to 'actionpack/lib/action_dispatch')
-rw-r--r-- | actionpack/lib/action_dispatch/http/response.rb | 9 |
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 |