Skip to content

Commit

Permalink
post-processing can be switched on and off at any time
Browse files Browse the repository at this point in the history
  • Loading branch information
yar authored and Jon Yurek committed Mar 9, 2011
1 parent 338fc35 commit 91c2338
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/paperclip/attachment.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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 = {}
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 91c2338

Please sign in to comment.