diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/action_mailbox/routing.rb | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/lib/action_mailbox/routing.rb b/lib/action_mailbox/routing.rb index b40e2774e4..d258b632f9 100644 --- a/lib/action_mailbox/routing.rb +++ b/lib/action_mailbox/routing.rb @@ -2,15 +2,17 @@ module ActionMailbox module Routing extend ActiveSupport::Concern - class_methods do - attr_reader :router + included do + cattr_accessor :router, default: ActionMailbox::Router.new + end + class_methods do def routing(routes) - (@router ||= ActionMailbox::Router.new).add_routes(routes) + router.add_routes(routes) end def route(inbound_email) - @router.route(inbound_email) + router.route(inbound_email) end end end |