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
scrapbook-0.3.2 vendor/ruby/2.7.0/gems/actionmailbox-7.0.2.3/app/models/action_mailbox/inbound_email/incineratable.rb
scrapbook-0.3.2 vendor/ruby/2.7.0/gems/actionmailbox-6.1.6.1/app/models/action_mailbox/inbound_email/incineratable.rb
scrapbook-0.3.2 vendor/ruby/2.7.0/gems/actionmailbox-7.0.3.1/app/models/action_mailbox/inbound_email/incineratable.rb
actionmailbox-7.1.2 app/models/action_mailbox/inbound_email/incineratable.rb
actionmailbox-7.1.1 app/models/action_mailbox/inbound_email/incineratable.rb
actionmailbox-7.1.0 app/models/action_mailbox/inbound_email/incineratable.rb
actionmailbox-7.1.0.rc2 app/models/action_mailbox/inbound_email/incineratable.rb
actionmailbox-7.1.0.rc1 app/models/action_mailbox/inbound_email/incineratable.rb
actionmailbox-7.1.0.beta1 app/models/action_mailbox/inbound_email/incineratable.rb
actionmailbox-7.0.8 app/models/action_mailbox/inbound_email/incineratable.rb
actionmailbox-7.0.7.2 app/models/action_mailbox/inbound_email/incineratable.rb
actionmailbox-6.1.7.6 app/models/action_mailbox/inbound_email/incineratable.rb
actionmailbox-7.0.7.1 app/models/action_mailbox/inbound_email/incineratable.rb
actionmailbox-6.1.7.5 app/models/action_mailbox/inbound_email/incineratable.rb
actionmailbox-7.0.7 app/models/action_mailbox/inbound_email/incineratable.rb
actionmailbox-7.0.6 app/models/action_mailbox/inbound_email/incineratable.rb
actionmailbox-7.0.5.1 app/models/action_mailbox/inbound_email/incineratable.rb
actionmailbox-6.1.7.4 app/models/action_mailbox/inbound_email/incineratable.rb
scrapbook-0.3.1 vendor/ruby/2.7.0/gems/actionmailbox-6.1.6.1/app/models/action_mailbox/inbound_email/incineratable.rb
scrapbook-0.3.1 vendor/ruby/2.7.0/gems/actionmailbox-7.0.3.1/app/models/action_mailbox/inbound_email/incineratable.rb