Permalink
Browse files

Fix for no uploaded file.

  • Loading branch information...
1 parent d8770ac commit 928dc3858bd24468500dad9743a054b76182c6fc @pk committed Nov 11, 2008
Showing with 2 additions and 1 deletion.
  1. +2 −1 lib/sequel_paperclip.rb
View
@@ -194,8 +194,9 @@ def has_attached_file name, options = {}
end
define_method "#{name}=" do |file|
+ file = nil if file.is_a?(String) && file == ''
# Transform Merb Mash to something what paperclip will understant
- file = MashFile.new(file) if file is_a? Mash
+ file = MashFile.new(file) if file.is_a?(Mash)
attachment_for(name).assign(file)
end

0 comments on commit 928dc38

Please sign in to comment.