Commit f455b296 by jyurek

Fixed issue with files not being found.

git-svn-id: https://svn.thoughtbot.com/plugins/paperclip/trunk@197 7bbfaf0e-4d1d-0410-9690-a8bb5f8ef2aa
parent 0919884f
......@@ -247,6 +247,8 @@ module Thoughtbot #:nodoc:
write_attachment attachments[attr] if attachments[attr][:files]
delete_attachment attachments[attr], attachments[attr][:complain_on_delete] if attachments[attr][:delete_on_save]
attachments[attr][:delete_on_save] = false
attachments[attr][:dirty] = false
attachments[attr][:files] = nil
end
end
private :"#{attr}_before_save"
......
......@@ -20,7 +20,7 @@ class PaperclipNonStandardTest < Test::Unit::TestCase
def test_should_save_the_created_file_to_the_final_asset_directory
assert @ns.save
assert File.exists?( @ns.resume_file_name ), @ns.resume_file_name
assert File.exists?( @ns.avatar_file_name(:original) )
assert File.exists?( @ns.avatar_file_name(:original) ), @ns.avatar_file_name(:original)
assert File.exists?( @ns.avatar_file_name(:bigger) )
assert File.exists?( @ns.avatar_file_name(:cropped) )
assert File.size?( @ns.avatar_file_name(:original) )
......@@ -49,7 +49,7 @@ class PaperclipNonStandardTest < Test::Unit::TestCase
def test_should_delete_files_on_destroy
assert @ns.save
assert File.exists?( @ns.resume_file_name ), @ns.resume_file_name
assert File.exists?( @ns.avatar_file_name(:original) )
assert File.exists?( @ns.avatar_file_name(:original) ), @ns.avatar_file_name(:original)
assert File.exists?( @ns.avatar_file_name(:bigger) )
assert File.exists?( @ns.avatar_file_name(:cropped) )
......
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