I've added the following code to my attachment model:
class Attachment < ActiveRecord::Base
has_attached_file :data
before_post_process :mark_as_unprocessed
after_post_process :mark_as_processed
process_in_background :data
private
def mark_as_unprocessed
assign_attributes(processed: false)
end
def mark_as_processed
assign_attributes(processed: true)
end
end
When I comment out the process_in_background directive, the attachment is successfully updated as processed: true, but when I process_in_background, it looks like the callbacks are not run. I'm not sure how to debug this.
I've added the following code to my attachment model:
When I comment out the
process_in_background
directive, the attachment is successfully updated asprocessed: true
, but when Iprocess_in_background
, it looks like the callbacks are not run. I'm not sure how to debug this.