diff options
author | Carlhuda <carlhuda@engineyard.com> | 2009-12-23 17:01:07 -0800 |
---|---|---|
committer | Carlhuda <carlhuda@engineyard.com> | 2009-12-23 17:23:29 -0800 |
commit | d2bd71a145ddc5e3e3750edc9a09eab742aaf02a (patch) | |
tree | da4a935d5d161090373aae6593453d910101c1c6 /actionmailer | |
parent | 61af34b001b295af36c346d245a65d74de0e1f97 (diff) | |
download | rails-d2bd71a145ddc5e3e3750edc9a09eab742aaf02a.tar.gz rails-d2bd71a145ddc5e3e3750edc9a09eab742aaf02a.tar.bz2 rails-d2bd71a145ddc5e3e3750edc9a09eab742aaf02a.zip |
Finish moving config.frameworks-dependent code to the framework plugin
Diffstat (limited to 'actionmailer')
-rw-r--r-- | actionmailer/lib/action_mailer/rails.rb | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/actionmailer/lib/action_mailer/rails.rb b/actionmailer/lib/action_mailer/rails.rb new file mode 100644 index 0000000000..a3573cdea7 --- /dev/null +++ b/actionmailer/lib/action_mailer/rails.rb @@ -0,0 +1,24 @@ +require "action_mailer" + +module ActionMailer + class Plugin < Rails::Plugin + plugin_name :action_mailer + + initializer "action_mailer.set_configs" do |app| + app.config.action_mailer.each do |k,v| + ActionMailer::Base.send "#{k}=", v + end + end + + # TODO: ActionController::Base.logger should delegate to its own config.logger + initializer "action_mailer.logger" do + ActionMailer::Base.logger ||= Rails.logger + end + + initializer "action_mailer.view_paths" do |app| + # TODO: this should be combined with the logic for default config.action_mailer.view_paths + view_path = ActionView::PathSet.type_cast(app.config.view_path, app.config.cache_classes) + ActionMailer::Base.template_root = view_path if ActionMailer::Base.view_paths.blank? + end + end +end
\ No newline at end of file |