jstorimer / delayed_paperclip

Process your Paperclip attachments in the background with delayed_job or Resque.

Home Page:https://github.com/jrgifford/delayed_paperclip/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

If before_post_process filter returns false the resource_processing field is not updated

bastien opened this issue · comments

I'm not sure wether this is a bug or by design, when the before_post_process filter returns false, the processing is halted but the resource_processing field is not updated.

I used to have this code

before_post_process :image?
process_in_background :resource

def image?
  resource_content_type =~ /image/ ? true : false
end

And after switching to delayed_paperclip 2.4.5.1 (and paperclip 2.4.5) I had to adapt my code to :

before_post_process :image?
process_in_background :resource

def image?
  return true if resource_content_type =~ /image/
  self.update_attribute(:resource_processing, false) # Had to add this line 
  false
end

Or is there a different way to come around this problem?