aboutsummaryrefslogtreecommitdiffstats
path: root/app/models/action_mailbox/inbound_email/routable.rb
blob: 1928f9e38798cb04100d1fea5591da256cb85a10 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
module ActionMailbox::InboundEmail::Routable
  extend ActiveSupport::Concern

  included do
    after_create_commit :route_later, if: ->(inbound_email) { inbound_email.pending? }
  end

  def route_later
    ActionMailbox::RoutingJob.perform_later self
  end
end