Skip to content

Commit

Permalink
ensure file is closed after being read
Browse files Browse the repository at this point in the history
  • Loading branch information
unknown committed Mar 18, 2011
1 parent 89f559b commit a7ba14c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/carrierwave/sanitized_file.rb
Expand Up @@ -148,7 +148,7 @@ def exists?
#
def read
if is_path?
File.open(@file, "rb").read
File.open(@file, "rb") {|file| file.read}
else
@file.rewind if @file.respond_to?(:rewind)
@file.read
Expand Down

0 comments on commit a7ba14c

Please sign in to comment.