Skip to content
Browse files

install ActionController::UrlFor before environment is parsed, to pro…

…vide ActionMailer#default_url_options=

Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
  • Loading branch information...
1 parent 459ecaf commit 363a752c36122c92d528aee83262f3ee2db460ae @paulrosania paulrosania committed with jeremy Feb 5, 2010
Showing with 5 additions and 5 deletions.
  1. +5 −5 actionmailer/lib/action_mailer/railtie.rb
View
10 actionmailer/lib/action_mailer/railtie.rb
@@ -5,6 +5,10 @@ module ActionMailer
class Railtie < Rails::Railtie
railtie_name :action_mailer
+ initializer "action_mailer.url_for", :before => :load_environment_config do |app|
+ ActionMailer::Base.send(:include, ActionController::UrlFor) if defined?(ActionController)
+ end
+
require "action_mailer/railties/subscriber"
subscriber ActionMailer::Railties::Subscriber.new
@@ -17,9 +21,5 @@ class Railtie < Rails::Railtie
ActionMailer::Base.send "#{k}=", v
end
end
-
- initializer "action_mailer.url_for" do |app|
- ActionMailer::Base.send(:include, ActionController::UrlFor) if defined?(ActionController)
- end
end
-end
+end

0 comments on commit 363a752

Please sign in to comment.
Something went wrong with that request. Please try again.