diff options
Diffstat (limited to 'app/models/action_mailroom/inbound_email')
-rw-r--r-- | app/models/action_mailroom/inbound_email/routable.rb | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/app/models/action_mailroom/inbound_email/routable.rb b/app/models/action_mailroom/inbound_email/routable.rb new file mode 100644 index 0000000000..b888c592f5 --- /dev/null +++ b/app/models/action_mailroom/inbound_email/routable.rb @@ -0,0 +1,12 @@ +module ActionMailroom::InboundEmail::Routable + extend ActiveSupport::Concern + + included do + after_create_commit :route_later, if: ->(r) { r.pending? } + end + + private + def route_later + ActionMailroom::RoutingJob.perform_later self + end +end |