diff options
author | Lin Jen-Shin <godfat@godfat.org> | 2016-06-15 16:31:28 +0800 |
---|---|---|
committer | Lin Jen-Shin <godfat@godfat.org> | 2016-06-15 16:31:28 +0800 |
commit | 3ced5ae68e7575ee3d4cd5b4b69f1d65b95d3285 (patch) | |
tree | 4a60030de4081448f7a1ade0590c23aada586e0a /lib | |
parent | 5608e1a159318892abc78ccbd8db1ac7090c6a80 (diff) | |
download | gitlab-ce-3ced5ae68e7575ee3d4cd5b4b69f1d65b95d3285.tar.gz |
Save the list of handlers in a constant
Diffstat (limited to 'lib')
-rw-r--r-- | lib/gitlab/email/handler.rb | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/gitlab/email/handler.rb b/lib/gitlab/email/handler.rb index 0824d453fed..bd3267e2a80 100644 --- a/lib/gitlab/email/handler.rb +++ b/lib/gitlab/email/handler.rb @@ -4,8 +4,10 @@ require 'gitlab/email/handler/create_issue_handler' module Gitlab module Email module Handler + HANDLERS = [CreateNoteHandler, CreateIssueHandler] + def self.for(mail, mail_key) - [CreateNoteHandler, CreateIssueHandler].find do |klass| + HANDLERS.find do |klass| handler = klass.new(mail, mail_key) break handler if handler.can_handle? end |