aboutsummaryrefslogblamecommitdiffstats
path: root/app/models/action_mailbox/inbound_email/incineratable.rb
blob: 198846422cdf97546bf04dba724a2ebb9f3f14c7 (plain) (tree)
1
2
3
4
5
6
7
8
9
                                                 

                               
             




                                                                                              




                              
   
module ActionMailbox::InboundEmail::Incineratable
  extend ActiveSupport::Concern

  included do
    after_update_commit :incinerate_later, if: -> { status_previously_changed? && processed? }
  end

  def incinerate_later
    ActionMailbox::IncinerationJob.schedule self
  end

  def incinerate
    Incineration.new(self).run
  end
end