aboutsummaryrefslogtreecommitdiffstats
path: root/actionmailer
diff options
context:
space:
mode:
Diffstat (limited to 'actionmailer')
-rw-r--r--actionmailer/lib/action_mailer/base.rb23
-rw-r--r--actionmailer/lib/action_mailer/railtie.rb7
2 files changed, 5 insertions, 25 deletions
diff --git a/actionmailer/lib/action_mailer/base.rb b/actionmailer/lib/action_mailer/base.rb
index 31e1b26afd..6ae3940e6d 100644
--- a/actionmailer/lib/action_mailer/base.rb
+++ b/actionmailer/lib/action_mailer/base.rb
@@ -361,7 +361,6 @@ module ActionMailer #:nodoc:
}.freeze
class << self
-
def mailer_name
@mailer_name ||= name.underscore
end
@@ -725,28 +724,6 @@ module ActionMailer #:nodoc:
container.add_part(part)
end
- module DeprecatedUrlOptions
- def default_url_options
- deprecated_url_options
- end
-
- def default_url_options=(val)
- deprecated_url_options
- end
-
- def deprecated_url_options
- raise "You can no longer call ActionMailer::Base.default_url_options " \
- "directly. You need to set config.action_mailer.default_url_options. " \
- "If you are using ActionMailer standalone, you need to include the " \
- "routing url_helpers directly."
- end
- end
-
- # This module will complain if the user tries to set default_url_options
- # directly instead of through the config object. In Action Mailer's Railtie,
- # we include the router's url_helpers, which will override this module.
- extend DeprecatedUrlOptions
-
ActiveSupport.run_load_hooks(:action_mailer, self)
end
end
diff --git a/actionmailer/lib/action_mailer/railtie.rb b/actionmailer/lib/action_mailer/railtie.rb
index ce6d8cc5b5..a2b00addc9 100644
--- a/actionmailer/lib/action_mailer/railtie.rb
+++ b/actionmailer/lib/action_mailer/railtie.rb
@@ -1,5 +1,6 @@
require "action_mailer"
require "rails"
+require "abstract_controller/railties/routes_helpers"
module ActionMailer
class Railtie < Rails::Railtie
@@ -18,9 +19,11 @@ module ActionMailer
options.stylesheets_dir ||= paths.public.stylesheets.to_a.first
ActiveSupport.on_load(:action_mailer) do
- include app.routes.url_helpers
+ include AbstractController::UrlFor
+ extend ::AbstractController::Railties::RoutesHelpers.with(app.routes)
+ include app.routes.mounted_helpers(:app)
options.each { |k,v| send("#{k}=", v) }
end
end
end
-end \ No newline at end of file
+end