From a5537818e559c5a30c1bf07dd49a1f4cb06fa1ea Mon Sep 17 00:00:00 2001 From: Mark Longair Date: Tue, 9 Apr 2013 15:57:13 +0100 Subject: Replace Dispatcher.to_prepare with Rails.configuration.to_prepare --- lib/patch_mailer_paths.rb | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'lib/patch_mailer_paths.rb') diff --git a/lib/patch_mailer_paths.rb b/lib/patch_mailer_paths.rb index d0a0b23..66348fb 100644 --- a/lib/patch_mailer_paths.rb +++ b/lib/patch_mailer_paths.rb @@ -2,8 +2,7 @@ # and at startup in production - to patch existing app classes. # See http://stackoverflow.com/questions/7072758/plugin-not-reloading-in-development-mode # -require 'dispatcher' -Dispatcher.to_prepare do +Rails.configuration.to_prepare do # Override mailer templates with theme ones. Note doing this in a before_filter, # as we do with the controller paths, doesn't seem to have any effect when # running in production -- cgit v1.2.3 From 6a038d1d2e5d9a98c57a75e5ac321ada0536c9fa Mon Sep 17 00:00:00 2001 From: Mark Longair Date: Tue, 9 Apr 2013 16:02:20 +0100 Subject: Fix the "can't modify frozen array" error with Rails 3 --- lib/patch_mailer_paths.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/patch_mailer_paths.rb') diff --git a/lib/patch_mailer_paths.rb b/lib/patch_mailer_paths.rb index 66348fb..7a524fa 100644 --- a/lib/patch_mailer_paths.rb +++ b/lib/patch_mailer_paths.rb @@ -6,5 +6,5 @@ Rails.configuration.to_prepare do # Override mailer templates with theme ones. Note doing this in a before_filter, # as we do with the controller paths, doesn't seem to have any effect when # running in production - ActionMailer::Base.view_paths.unshift File.join(File.dirname(__FILE__), "views") + ActionMailer::Base.prepend_view_path File.join(File.dirname(__FILE__), "views") end -- cgit v1.2.3