diff options
Diffstat (limited to 'actionpack')
-rw-r--r-- | actionpack/lib/abstract_controller/asset_paths.rb | 2 | ||||
-rw-r--r-- | actionpack/lib/action_controller/base.rb | 1 | ||||
-rw-r--r-- | actionpack/lib/action_controller/railtie.rb | 33 | ||||
-rw-r--r-- | actionpack/lib/action_controller/railties/url_helpers.rb | 14 |
4 files changed, 15 insertions, 35 deletions
diff --git a/actionpack/lib/abstract_controller/asset_paths.rb b/actionpack/lib/abstract_controller/asset_paths.rb index 6d6f6ac607..9ca2fb742f 100644 --- a/actionpack/lib/abstract_controller/asset_paths.rb +++ b/actionpack/lib/abstract_controller/asset_paths.rb @@ -3,7 +3,7 @@ module AbstractController extend ActiveSupport::Concern included do - config_accessor :assets_dir, :javascripts_dir, :stylesheets_dir + config_accessor :asset_host, :asset_path, :assets_dir, :javascripts_dir, :stylesheets_dir end end end
\ No newline at end of file diff --git a/actionpack/lib/action_controller/base.rb b/actionpack/lib/action_controller/base.rb index 1c6896d362..9dfffced75 100644 --- a/actionpack/lib/action_controller/base.rb +++ b/actionpack/lib/action_controller/base.rb @@ -63,7 +63,6 @@ module ActionController klass.helper :all end - config_accessor :asset_host, :asset_path ActiveSupport.run_load_hooks(:action_controller, self) 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 |