Skip to content

Commit

Permalink
Merge pull request #2367 from nagatea/refactor_sanitized_file_path
Browse files Browse the repository at this point in the history
Small refactor
  • Loading branch information
mshibuya committed Jan 26, 2019
2 parents 677e1d6 + be47c82 commit a91ab69
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions lib/carrierwave/sanitized_file.rb
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 a91ab69

Please sign in to comment.