OSDN Git Service

Introduced MailHandler#dispatch_to_default method to make MailHandler more extensible...
authorJean-Baptiste Barth <jeanbaptiste.barth@gmail.com>
Sat, 12 Feb 2011 10:08:11 +0000 (10:08 +0000)
committerJean-Baptiste Barth <jeanbaptiste.barth@gmail.com>
Sat, 12 Feb 2011 10:08:11 +0000 (10:08 +0000)
Contributed by Yuki Sonoda

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@4820 e93f8b46-1217-0410-a6f0-8f06a7374b81

app/models/mail_handler.rb

index 1410a60..e509d09 100644 (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
@@ -113,6 +113,10 @@ class MailHandler < ActionMailer::Base
     logger.error "MailHandler: unauthorized attempt from #{user}" if logger
     false
   end
+
+  def dispatch_to_default
+    receive_issue
+  end
   
   # Creates a new issue
   def receive_issue