aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--actionmailer/lib/action_mailer/railtie.rb17
-rw-r--r--actionpack/lib/action_controller/railtie.rb33
-rw-r--r--actionpack/lib/action_controller/railties/url_helpers.rb14
3 files changed, 20 insertions, 44 deletions
diff --git a/actionmailer/lib/action_mailer/railtie.rb b/actionmailer/lib/action_mailer/railtie.rb
index d7b09b2dc6..ce6d8cc5b5 100644
--- a/actionmailer/lib/action_mailer/railtie.rb
+++ b/actionmailer/lib/action_mailer/railtie.rb
@@ -10,21 +10,16 @@ module ActionMailer
end
initializer "action_mailer.set_configs" do |app|
- paths = app.config.paths
- am = app.config.action_mailer
+ paths = app.config.paths
+ options = app.config.action_mailer
- am.assets_dir ||= paths.public.to_a.first
- am.javascripts_dir ||= paths.public.javascripts.to_a.first
- am.stylesheets_dir ||= paths.public.stylesheets.to_a.first
+ options.assets_dir ||= paths.public.to_a.first
+ options.javascripts_dir ||= paths.public.javascripts.to_a.first
+ options.stylesheets_dir ||= paths.public.stylesheets.to_a.first
ActiveSupport.on_load(:action_mailer) do
- self.config.merge!(am)
-
include app.routes.url_helpers
-
- app.config.action_mailer.each do |k,v|
- send "#{k}=", v
- end
+ options.each { |k,v| send("#{k}=", v) }
end
end
end
diff --git a/actionpack/lib/action_controller/railtie.rb b/actionpack/lib/action_controller/railtie.rb
index 9261422f0b..cd2dfafbe6 100644
--- a/actionpack/lib/action_controller/railtie.rb
+++ b/actionpack/lib/action_controller/railtie.rb
@@ -5,8 +5,6 @@ require "action_view/railtie"
require "active_support/deprecation/proxy_wrappers"
require "active_support/deprecation"
-require "action_controller/railties/url_helpers"
-
module ActionController
class Railtie < Rails::Railtie
config.action_controller = ActiveSupport::OrderedOptions.new
@@ -33,21 +31,6 @@ module ActionController
end
end
- initializer "action_controller.set_configs" do |app|
- paths = app.config.paths
- ac = app.config.action_controller
-
- ac.assets_dir ||= paths.public.to_a.first
- ac.javascripts_dir ||= paths.public.javascripts.to_a.first
- ac.stylesheets_dir ||= paths.public.stylesheets.to_a.first
- ac.page_cache_directory ||= paths.public.to_a.first
- ac.helpers_path ||= paths.app.helpers.to_a
-
- ActiveSupport.on_load(:action_controller) do
- self.config.merge!(ac)
- end
- end
-
initializer "action_controller.logger" do
ActiveSupport.on_load(:action_controller) { self.logger ||= Rails.logger }
end
@@ -56,11 +39,23 @@ module ActionController
ActiveSupport.on_load(:action_controller) { self.cache_store ||= RAILS_CACHE }
end
- initializer "action_controller.url_helpers" do |app|
+ initializer "action_controller.set_configs" do |app|
+ paths = app.config.paths
+ options = app.config.action_controller
+
+ options.assets_dir ||= paths.public.to_a.first
+ options.javascripts_dir ||= paths.public.javascripts.to_a.first
+ options.stylesheets_dir ||= paths.public.stylesheets.to_a.first
+ options.page_cache_directory ||= paths.public.to_a.first
+ options.helpers_path ||= paths.app.helpers.to_a
+
ActiveSupport.on_load(:action_controller) do
- extend ::ActionController::Railties::UrlHelpers.with(app.routes)
+ include app.routes.url_helpers
+ options.each { |k,v| send("#{k}=", v) }
end
+ end
+ initializer "action_controller.deprecated_routes" do |app|
message = "ActionController::Routing::Routes is deprecated. " \
"Instead, use Rails.application.routes"
diff --git a/actionpack/lib/action_controller/railties/url_helpers.rb b/actionpack/lib/action_controller/railties/url_helpers.rb
deleted file mode 100644
index 9df5665542..0000000000
--- a/actionpack/lib/action_controller/railties/url_helpers.rb
+++ /dev/null
@@ -1,14 +0,0 @@
-module ActionController
- module Railties
- module UrlHelpers
- def self.with(routes)
- Module.new do
- define_method(:inherited) do |klass|
- super(klass)
- klass.send(:include, routes.url_helpers)
- end
- end
- end
- end
- end
-end