From dab08597417d55a1e9819781427aa2097ecdf2fb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sergio=20Gil=20P=C3=A9rez=20de=20la=20Manga?= Date: Thu, 20 Sep 2012 11:57:38 +0200 Subject: Delegate ActionDispatch::Http::UploadedFile#close to tempfile --- actionpack/lib/action_dispatch/http/upload.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'actionpack/lib') diff --git a/actionpack/lib/action_dispatch/http/upload.rb b/actionpack/lib/action_dispatch/http/upload.rb index ce8c2729e9..42da35edec 100644 --- a/actionpack/lib/action_dispatch/http/upload.rb +++ b/actionpack/lib/action_dispatch/http/upload.rb @@ -17,7 +17,7 @@ module ActionDispatch end # Delegate these methods to the tempfile. - [:open, :path, :rewind, :size, :eof?].each do |method| + [:open, :close, :path, :rewind, :size, :eof?].each do |method| class_eval "def #{method}; @tempfile.#{method}; end" end -- cgit v1.2.3 From e9ba548baf74cc3a5ec65135dac385d81e14f06e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sergio=20Gil=20P=C3=A9rez=20de=20la=20Manga?= Date: Sat, 22 Sep 2012 22:37:00 +0200 Subject: Accept parameters in methods delegated to tempfile --- actionpack/lib/action_dispatch/http/upload.rb | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'actionpack/lib') diff --git a/actionpack/lib/action_dispatch/http/upload.rb b/actionpack/lib/action_dispatch/http/upload.rb index 42da35edec..d50c8cad17 100644 --- a/actionpack/lib/action_dispatch/http/upload.rb +++ b/actionpack/lib/action_dispatch/http/upload.rb @@ -12,13 +12,9 @@ module ActionDispatch @headers = hash[:head] end - def read(*args) - @tempfile.read(*args) - end - # Delegate these methods to the tempfile. - [:open, :close, :path, :rewind, :size, :eof?].each do |method| - class_eval "def #{method}; @tempfile.#{method}; end" + [:read, :open, :close, :path, :rewind, :size, :eof?].each do |method| + class_eval "def #{method}(*args); @tempfile.#{method}(*args); end" end private -- cgit v1.2.3