1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Merge pull request #4094 from lest/remove-1-8-code

remove check for string from request body setter
This commit is contained in:
José Valim 2011-12-21 06:46:01 -08:00
commit 2ba3d135e3

View file

@ -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