Commit b4385bd4 by Jon Yurek

Removes some confusion from ContenTypeDetector methods

parent 126dab11
...@@ -8,9 +8,9 @@ module Paperclip ...@@ -8,9 +8,9 @@ module Paperclip
end end
def detect def detect
if blank? if blank_name?
SENSIBLE_DEFAULT SENSIBLE_DEFAULT
elsif empty? elsif empty_file?
EMPTY_TYPE EMPTY_TYPE
elsif !match? elsif !match?
type_from_file_command type_from_file_command
...@@ -23,11 +23,11 @@ module Paperclip ...@@ -23,11 +23,11 @@ module Paperclip
private private
def empty? def empty_file?
File.exists?(@filename) && File.size(@filename) == 0 File.exists?(@filename) && File.size(@filename) == 0
end end
def blank? def blank_name?
@filename.nil? || @filename.empty? @filename.nil? || @filename.empty?
end end
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment