提交 4790e02e 编写于 作者: J Jeremy Kemper

Ruby 1.9 compat: work around that String is not Enumerable

上级 75b2e7e9
......@@ -326,7 +326,11 @@ def process(method, path, parameters = nil, headers = nil)
end
@body = ""
body.each { |part| @body << part }
if body.is_a?(String)
@body << body
else
body.each { |part| @body << part }
end
if @controller = ActionController::Base.last_instantiation
@request = @controller.request
......
......@@ -46,7 +46,7 @@ def get_typed_value(value)
when Array
value.map { |v| get_typed_value(v) }
when Hash
if value.has_key?(:tempfile) && value[:filename].any?
if value.has_key?(:tempfile) && !value[:filename].blank?
upload = value[:tempfile]
upload.extend(UploadedFile)
upload.original_path = value[:filename]
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册