1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00
rails--rails/app/models/action_mailbox/inbound_email/routable.rb

16 lines
316 B
Ruby
Raw Normal View History

module ActionMailbox::InboundEmail::Routable
2018-09-19 19:40:56 -04:00
extend ActiveSupport::Concern
included do
2018-09-19 19:44:48 -04:00
after_create_commit :route_later, if: ->(inbound_email) { inbound_email.pending? }
2018-09-19 19:40:56 -04:00
end
2018-09-28 14:32:44 -04:00
def route_later
ActionMailbox::RoutingJob.perform_later self
2018-09-28 14:32:44 -04:00
end
def route
ApplicationMailbox.route self
end
2018-09-19 19:40:56 -04:00
end