From 284ca810c17a89d15d809ba203289487044fcff9 Mon Sep 17 00:00:00 2001 From: Josh Kalderimis Date: Sat, 2 Apr 2011 10:51:47 +0200 Subject: remove AM delegating register_observer and register_interceptor to Mail and instead implement smarter versions allowing for string class names, also added proper Railtie support with tests. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: José Valim --- actionmailer/lib/action_mailer/railtie.rb | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'actionmailer/lib/action_mailer/railtie.rb') diff --git a/actionmailer/lib/action_mailer/railtie.rb b/actionmailer/lib/action_mailer/railtie.rb index 4ec478067f..444754d0e9 100644 --- a/actionmailer/lib/action_mailer/railtie.rb +++ b/actionmailer/lib/action_mailer/railtie.rb @@ -19,13 +19,17 @@ module ActionMailer options.stylesheets_dir ||= paths["public/stylesheets"].first # make sure readers methods get compiled - options.asset_path ||= app.config.asset_path - options.asset_host ||= app.config.asset_host + options.asset_path ||= app.config.asset_path + options.asset_host ||= app.config.asset_host ActiveSupport.on_load(:action_mailer) do include AbstractController::UrlFor extend ::AbstractController::Railties::RoutesHelpers.with(app.routes) include app.routes.mounted_helpers + + register_interceptors(options.delete(:interceptors)) + register_observers(options.delete(:observers)) + options.each { |k,v| send("#{k}=", v) } end end -- cgit v1.2.3