1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

ActionMailer should not depend on ActionDispatch

This commit is contained in:
Piotr Sarnacki 2010-08-04 17:15:34 +02:00
parent f3c703a32f
commit 56ef192374
3 changed files with 2 additions and 3 deletions

View file

@ -26,7 +26,6 @@ $:.unshift(actionpack_path) if File.directory?(actionpack_path) && !$:.include?(
require 'abstract_controller' require 'abstract_controller'
require 'action_view' require 'action_view'
require 'action_dispatch'
# Common Active Support usage in Action Mailer # Common Active Support usage in Action Mailer
require 'active_support/core_ext/class' require 'active_support/core_ext/class'

View file

@ -340,7 +340,6 @@ module ActionMailer #:nodoc:
include AbstractController::Helpers include AbstractController::Helpers
include AbstractController::Translation include AbstractController::Translation
include AbstractController::AssetPaths include AbstractController::AssetPaths
include AbstractController::UrlFor
cattr_reader :protected_instance_variables cattr_reader :protected_instance_variables
@@protected_instance_variables = [] @@protected_instance_variables = []
@ -364,7 +363,7 @@ module ActionMailer #:nodoc:
class << self class << self
def inherited(klass) def inherited(klass)
super(klass) super(klass)
klass.class_eval { @action_methods = nil } klass.clear_action_methods!
end end
def mailer_name def mailer_name

View file

@ -19,6 +19,7 @@ module ActionMailer
options.stylesheets_dir ||= paths.public.stylesheets.to_a.first options.stylesheets_dir ||= paths.public.stylesheets.to_a.first
ActiveSupport.on_load(:action_mailer) do ActiveSupport.on_load(:action_mailer) do
include AbstractController::UrlFor
extend ::AbstractController::Railties::RoutesHelpers.with(app.routes) extend ::AbstractController::Railties::RoutesHelpers.with(app.routes)
include app.routes.mounted_helpers(:app) include app.routes.mounted_helpers(:app)
options.each { |k,v| send("#{k}=", v) } options.each { |k,v| send("#{k}=", v) }