Sha256: f25ed9d6ab9bd4e2f9a46c1a61430e9b4bf464a2ab03b94d15ad4616873eee95

Contents?: true

Size: 664 Bytes

Versions: 146

Compression:

Stored size: 664 Bytes

Contents

# frozen_string_literal: true

# Ensure that the +InboundEmail+ is automatically scheduled for later incineration if the status has been
# changed to +processed+. The later incineration will be invoked at the time specified by the
# +ActionMailbox.incinerate_after+ time using the +IncinerationJob+.
module ActionMailbox::InboundEmail::Incineratable
  extend ActiveSupport::Concern

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

  def incinerate_later
    ActionMailbox::IncinerationJob.schedule self
  end

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

Version data entries

146 entries across 141 versions & 11 rubygems

Version Path
actionmailbox-8.0.0 app/models/action_mailbox/inbound_email/incineratable.rb
actionmailbox-7.2.2 app/models/action_mailbox/inbound_email/incineratable.rb
actionmailbox-7.1.5 app/models/action_mailbox/inbound_email/incineratable.rb
actionmailbox-8.0.0.rc2 app/models/action_mailbox/inbound_email/incineratable.rb
actionmailbox-7.2.1.2 app/models/action_mailbox/inbound_email/incineratable.rb
actionmailbox-7.1.4.2 app/models/action_mailbox/inbound_email/incineratable.rb
actionmailbox-7.0.8.6 app/models/action_mailbox/inbound_email/incineratable.rb
actionmailbox-6.1.7.10 app/models/action_mailbox/inbound_email/incineratable.rb
actionmailbox-8.0.0.rc1 app/models/action_mailbox/inbound_email/incineratable.rb
actionmailbox-6.1.7.9 app/models/action_mailbox/inbound_email/incineratable.rb
actionmailbox-7.2.1.1 app/models/action_mailbox/inbound_email/incineratable.rb
actionmailbox-7.1.4.1 app/models/action_mailbox/inbound_email/incineratable.rb
actionmailbox-7.0.8.5 app/models/action_mailbox/inbound_email/incineratable.rb
actionmailbox-8.0.0.beta1 app/models/action_mailbox/inbound_email/incineratable.rb
omg-actionmailbox-8.0.0.alpha9 app/models/action_mailbox/inbound_email/incineratable.rb
omg-actionmailbox-8.0.0.alpha8 app/models/action_mailbox/inbound_email/incineratable.rb
omg-actionmailbox-8.0.0.alpha7 app/models/action_mailbox/inbound_email/incineratable.rb
omg-actionmailbox-8.0.0.alpha4 app/models/action_mailbox/inbound_email/incineratable.rb
omg-actionmailbox-8.0.0.alpha3 app/models/action_mailbox/inbound_email/incineratable.rb
actionmailbox-7.1.4 app/models/action_mailbox/inbound_email/incineratable.rb