Skip to content
Browse files

post-processing can be switched on and off at any time

  • Loading branch information...
1 parent 338fc35 commit 91c2338578e50a718c8e615a58911d73b330801c yar committed with jyurek Mar 7, 2011
Showing with 3 additions and 1 deletion.
  1. +3 −1 lib/paperclip/attachment.rb
View
4 lib/paperclip/attachment.rb
@@ -25,6 +25,7 @@ def self.default_options
end
attr_reader :name, :instance, :default_style, :convert_options, :queued_for_write, :whiny, :options
+ attr_accessor :post_processing
# Creates an Attachment object. +name+ is the name of the attachment,
# +instance+ is the ActiveRecord object instance it's attached to, and
@@ -53,6 +54,7 @@ def initialize name, instance, options = {}
@convert_options = options[:convert_options]
@processors = options[:processors]
@options = options
+ @post_processing = true
@queued_for_delete = []
@queued_for_write = {}
@errors = {}
@@ -105,7 +107,7 @@ def assign uploaded_file
@dirty = true
- post_process
+ post_process if @post_processing
# Reset the file size if the original file was reprocessed.
instance_write(:file_size, @queued_for_write[:original].size.to_i)

1 comment on commit 91c2338

@nickhoffman

How the "post_processing" attribute meant to be used?

Please sign in to comment.
Something went wrong with that request. Please try again.