Browse files

Ruby 1.9 compat: work around that String is not Enumerable

  • Loading branch information...
1 parent 75b2e7e commit 4790e02e74b2b5b5ff2e2fa89d2ce7af4d5a1877 @jeremy jeremy committed Jan 31, 2009
View
6 actionpack/lib/action_controller/integration.rb
@@ -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
View
2 actionpack/lib/action_controller/url_encoded_pair_parser.rb
@@ -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]

0 comments on commit 4790e02

Please sign in to comment.