Skip to content

Commit

Permalink
huh
Browse files Browse the repository at this point in the history
  • Loading branch information
suttree committed Dec 19, 2012
1 parent 68fb6da commit 24f71c0
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions lib/delayed_paperclip/attachment.rb
Expand Up @@ -41,20 +41,17 @@ def process_delayed!
self.post_processing = true
reprocess!
self.job_is_processing = false
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?")

if instance.respond_to?(:"#{name}_processing?")
instance.send("#{name}_processing=", false)
instance.class.update_all({ "#{name}_processing" => false }, instance.class.primary_key => instance.id)
end
end

def after_flush_writes_with_processing(*args)
after_flush_writes_without_processing(*args)
end

def save_with_prepare_enqueueing
was_dirty = @dirty
save_without_prepare_enqueueing.tap do
Expand Down

0 comments on commit 24f71c0

Please sign in to comment.