lib/delayed_paperclip/attachment.rb in delayed_paperclip-2.5.1.0 vs lib/delayed_paperclip/attachment.rb in delayed_paperclip-2.6.0.0
- old
+ new
@@ -37,32 +37,45 @@
end
def process_delayed!
self.job_is_processing = true
self.post_processing = true
- reprocess!
+ reprocess!(*delayed_options[:only_process])
self.job_is_processing = false
end
+ def processing_image_url
+ processing_image_url = @options[:delayed][:processing_image_url]
+ processing_image_url = processing_image_url.call(self) if processing_image_url.respond_to?(:call)
+ processing_image_url
+ end
+
+
def after_flush_writes_with_processing(*args)
after_flush_writes_without_processing(*args)
# update_column is available in rails 3.1 instead we can do this to update the attribute without callbacks
- #instance.update_column("#{name}_processing", false) if instance.respond_to?(:"#{name}_processing?")
+ # instance.update_column("#{name}_processing", false) if instance.respond_to?(:"#{name}_processing?")
if instance.respond_to?(:"#{name}_processing?")
instance.send("#{name}_processing=", false)
- instance.class.update_all({ "#{name}_processing" => false }, instance.class.primary_key => instance.id)
+ instance.class.where(instance.class.primary_key => instance.id).update_all({ "#{name}_processing" => false })
end
end
def save_with_prepare_enqueueing
was_dirty = @dirty
+
save_without_prepare_enqueueing.tap do
if delay_processing? && was_dirty
instance.prepare_enqueueing_for name
end
end
+ end
+
+ def reprocess_without_delay!(*style_args)
+ @post_processing_with_delay = true
+ reprocess!(*style_args)
end
end
end
end