[#170] Refactor MailHandler to support a default dispatch method

Contributed by Yuki Sonoda
This commit is contained in:
Eric Davis 2011-02-14 15:48:18 -08:00
parent a47a7a2b99
commit a47ad014f9

View File

@ -100,7 +100,7 @@ class MailHandler < ActionMailer::Base
elsif m = email.subject.match(MESSAGE_REPLY_SUBJECT_RE)
receive_message_reply(m[1].to_i)
else
receive_issue
dispatch_to_default
end
rescue ActiveRecord::RecordInvalid => e
# TODO: send a email to the user
@ -114,6 +114,10 @@ class MailHandler < ActionMailer::Base
false
end
def dispatch_to_default
receive_issue
end
# Creates a new issue
def receive_issue
project = target_project