Commit 74616ece authored by Sean McGivern's avatar Sean McGivern

Extract EE-specific lines from Gitlab::Email::Handler

parent a3382bab
......@@ -6,15 +6,21 @@ require 'gitlab/email/handler/unsubscribe_handler'
module Gitlab
module Email
module Handler
HANDLERS = [
UnsubscribeHandler,
CreateNoteHandler,
CreateMergeRequestHandler,
CreateIssueHandler
].freeze
def self.handlers
@handlers ||= load_handlers
end
def self.load_handlers
[
UnsubscribeHandler,
CreateNoteHandler,
CreateMergeRequestHandler,
CreateIssueHandler
]
end
def self.for(mail, mail_key)
HANDLERS.find do |klass|
handlers.find do |klass|
handler = klass.new(mail, mail_key)
break handler if handler.can_handle?
end
......
......@@ -40,7 +40,7 @@ describe Gitlab::Email::Handler do
end
def ce_handlers
@ce_handlers ||= Gitlab::Email::Handler::HANDLERS.reject do |handler|
@ce_handlers ||= Gitlab::Email::Handler.handlers.reject do |handler|
handler.name.start_with?('Gitlab::Email::Handler::EE::')
end
end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment