Commit 92a5b071 by Jon Yurek

Merge pull request #1376 from gmarik/patch-1

removes duplication
parents 2fb4ba9e c0503d2b
...@@ -46,15 +46,13 @@ module Paperclip ...@@ -46,15 +46,13 @@ module Paperclip
def empty_file? def empty_file?
File.exists?(@filename) && File.size(@filename) == 0 File.exists?(@filename) && File.size(@filename) == 0
end end
alias :empty? :empty_file?
def blank_name? def blank_name?
@filename.nil? || @filename.empty? @filename.nil? || @filename.empty?
end end
def empty?
File.exists?(@filename) && File.size(@filename) == 0
end
def possible_types def possible_types
MIME::Types.type_for(@filename).collect(&:content_type) MIME::Types.type_for(@filename).collect(&:content_type)
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