Permalink
Browse files

add the keep_old_files option

  • Loading branch information...
1 parent 75ba69d commit d3f6600fa9e4b217bbf3103b1a4b5e13d1191af0 @teefax committed Dec 6, 2011
Showing with 1 addition and 1 deletion.
  1. +1 −1 lib/paperclip/attachment.rb
@@ -174,7 +174,7 @@ def dirty?
# Saves the file, if there are no errors. If there are, it flushes them to
# the instance's errors and returns false, cancelling the save.
def save
- flush_deletes
+ flush_deletes unless @options[:keep_old_files]
flush_writes
@dirty = false
true

3 comments on commit d3f6600

This actually looks nice. Do you mind adding test case, documentation (about the configuration at has_attached_file) so I can pull this one in to master?

Owner

teefax replied Dec 13, 2011

This is just the code change I needed to get an old app working again -- it's originally from pcreux/paperclip@5237495 -- there are tests and documentation in @pcreux commit.

Owner

teefax replied Dec 13, 2011

Please see thoughtbot#674

Please sign in to comment.