aboutsummaryrefslogtreecommitdiffstats
path: root/actionmailer/lib
diff options
context:
space:
mode:
authorJoel Chippindale <joel.chippindale@gmail.com>2008-11-11 09:39:50 -0600
committerJoshua Peek <josh@joshpeek.com>2008-11-11 09:46:29 -0600
commita62e9e90d8f47a643c9355f782ab4891fa8fefaa (patch)
tree8ab500e23d5a940f4bc277bbdcb73a9006c55ed1 /actionmailer/lib
parent78a18392e15c3de1c70b44e285d1742687624dd1 (diff)
downloadrails-a62e9e90d8f47a643c9355f782ab4891fa8fefaa.tar.gz
rails-a62e9e90d8f47a643c9355f782ab4891fa8fefaa.tar.bz2
rails-a62e9e90d8f47a643c9355f782ab4891fa8fefaa.zip
Fix for ActionMailer::Base.method_missing so that it raises NoMethodError when no method is found [#1330 state:resolved]
Signed-off-by: Joshua Peek <josh@joshpeek.com>
Diffstat (limited to 'actionmailer/lib')
-rw-r--r--actionmailer/lib/action_mailer/base.rb14
1 files changed, 8 insertions, 6 deletions
diff --git a/actionmailer/lib/action_mailer/base.rb b/actionmailer/lib/action_mailer/base.rb
index d63a608109..17b5eaa8d1 100644
--- a/actionmailer/lib/action_mailer/base.rb
+++ b/actionmailer/lib/action_mailer/base.rb
@@ -386,12 +386,14 @@ module ActionMailer #:nodoc:
end
def method_missing(method_symbol, *parameters) #:nodoc:
- match = matches_dynamic_method?(method_symbol)
- case match[1]
- when 'create' then new(match[2], *parameters).mail
- when 'deliver' then new(match[2], *parameters).deliver!
- when 'new' then nil
- else super
+ if match = matches_dynamic_method?(method_symbol)
+ case match[1]
+ when 'create' then new(match[2], *parameters).mail
+ when 'deliver' then new(match[2], *parameters).deliver!
+ when 'new' then nil
+ end
+ else
+ super
end
end