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

remove check for string from request body setter

it was required on ruby 1.8
This commit is contained in:
lest 2011-12-21 15:03:35 +03:00
parent 893d38d7fd
commit 127d2c8299

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