Skip to content

Commit

Permalink
Refactor SanitizedFile#path
Browse files Browse the repository at this point in the history
  • Loading branch information
nagatea committed Jan 26, 2019
1 parent ff0ffc0 commit be47c82
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions lib/carrierwave/sanitized_file.rb
Original file line number Diff line number Diff line change
Expand Up @@ -114,12 +114,11 @@ def size
# [String, nil] the path where the file is located.
#
def path
unless @file.blank?
if is_path?
File.expand_path(@file)
elsif @file.respond_to?(:path) and not @file.path.blank?
File.expand_path(@file.path)
end
return if @file.blank?
if is_path?
File.expand_path(@file)
elsif @file.respond_to?(:path) && !@file.path.blank?
File.expand_path(@file.path)
end
end

Expand Down

0 comments on commit be47c82

Please sign in to comment.