aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJosh Kalderimis <josh.kalderimis@gmail.com>2011-04-04 19:26:41 +0800
committerJosé Valim <jose.valim@gmail.com>2011-04-06 02:45:37 +0800
commitcb9e501a2893ec7e210a1de2550cb1ecf16d5c90 (patch)
treee5a190b1594e9ec610a8cffdf879f4e5c1ecbed6
parentd907f3cb5c5c610f2f8ac31410734c715d4b7548 (diff)
downloadrails-cb9e501a2893ec7e210a1de2550cb1ecf16d5c90.tar.gz
rails-cb9e501a2893ec7e210a1de2550cb1ecf16d5c90.tar.bz2
rails-cb9e501a2893ec7e210a1de2550cb1ecf16d5c90.zip
AM register_interceptor and register_observer only constantize if the argument is a String
-rw-r--r--actionmailer/lib/action_mailer/base.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/actionmailer/lib/action_mailer/base.rb b/actionmailer/lib/action_mailer/base.rb
index c21fd764b9..cd76383931 100644
--- a/actionmailer/lib/action_mailer/base.rb
+++ b/actionmailer/lib/action_mailer/base.rb
@@ -375,7 +375,7 @@ module ActionMailer #:nodoc:
# Either a class or a string can be passed in as the Observer. If a string is passed in
# it will be <tt>constantize</tt>d.
def register_observer(observer)
- delivery_observer = (observer.respond_to?(:delivered_email) ? observer : observer.constantize)
+ delivery_observer = (observer.is_a?(String) ? observer.constantize : observer)
Mail.register_observer(delivery_observer)
end
@@ -383,7 +383,7 @@ module ActionMailer #:nodoc:
# Either a class or a string can be passed in as the Observer. If a string is passed in
# it will be <tt>constantize</tt>d.
def register_interceptor(interceptor)
- delivery_interceptor = (interceptor.respond_to?(:delivering_email) ? interceptor : interceptor.constantize)
+ delivery_interceptor = (interceptor.is_a?(String) ? interceptor.constantize : interceptor)
Mail.register_interceptor(delivery_interceptor)
end