aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack
diff options
context:
space:
mode:
authorJeremy Kemper <jeremy@bitsweat.net>2009-01-31 10:55:47 -0800
committerJeremy Kemper <jeremy@bitsweat.net>2009-01-31 10:55:47 -0800
commit4790e02e74b2b5b5ff2e2fa89d2ce7af4d5a1877 (patch)
treea6c286e731150f0c16d71fa312d54aeb9d5caacd /actionpack
parent75b2e7e9c90b6229f7ef1a5f3d7ccce44caf6855 (diff)
downloadrails-4790e02e74b2b5b5ff2e2fa89d2ce7af4d5a1877.tar.gz
rails-4790e02e74b2b5b5ff2e2fa89d2ce7af4d5a1877.tar.bz2
rails-4790e02e74b2b5b5ff2e2fa89d2ce7af4d5a1877.zip
Ruby 1.9 compat: work around that String is not Enumerable
Diffstat (limited to 'actionpack')
-rw-r--r--actionpack/lib/action_controller/integration.rb6
-rw-r--r--actionpack/lib/action_controller/url_encoded_pair_parser.rb2
2 files changed, 6 insertions, 2 deletions
diff --git a/actionpack/lib/action_controller/integration.rb b/actionpack/lib/action_controller/integration.rb
index 163ba84a3e..fd3c30a92f 100644
--- a/actionpack/lib/action_controller/integration.rb
+++ b/actionpack/lib/action_controller/integration.rb
@@ -326,7 +326,11 @@ module ActionController
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
diff --git a/actionpack/lib/action_controller/url_encoded_pair_parser.rb b/actionpack/lib/action_controller/url_encoded_pair_parser.rb
index 57594c4259..b17b8a31aa 100644
--- a/actionpack/lib/action_controller/url_encoded_pair_parser.rb
+++ b/actionpack/lib/action_controller/url_encoded_pair_parser.rb
@@ -46,7 +46,7 @@ module ActionController
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]