Permalink
Browse files

Return SanitizedFile#file if it is already a File

  • Loading branch information...
1 parent 7cafd3f commit e12b6e4494c0daa24d2f3ebc5fb17e0b26403abf @chrisdurtschi chrisdurtschi committed Sep 20, 2011
Showing with 1 addition and 0 deletions.
  1. +1 −0 lib/carrierwave/sanitized_file.rb
@@ -224,6 +224,7 @@ def delete
# [File] a File object representing the SanitizedFile
#
def to_file
+ return @file if @file.is_a?(File)
File.open(@file) if exists?
end

0 comments on commit e12b6e4

Please sign in to comment.