diff options
author | José Valim <jose.valim@gmail.com> | 2010-07-24 00:48:12 +0200 |
---|---|---|
committer | José Valim <jose.valim@gmail.com> | 2010-07-24 00:48:12 +0200 |
commit | 76b6136b00a9d0a74f99ca4f1ae347230bde94e0 (patch) | |
tree | cd6f33c1215b87b6971535cfed9e383e59139433 /actionpack/lib | |
parent | 2af8fd2829ec573ef7da8a44d31e5f25ef4a8408 (diff) | |
download | rails-76b6136b00a9d0a74f99ca4f1ae347230bde94e0.tar.gz rails-76b6136b00a9d0a74f99ca4f1ae347230bde94e0.tar.bz2 rails-76b6136b00a9d0a74f99ca4f1ae347230bde94e0.zip |
Clean up AM and AC railties.
Diffstat (limited to 'actionpack/lib')
-rw-r--r-- | actionpack/lib/action_controller/railtie.rb | 33 | ||||
-rw-r--r-- | actionpack/lib/action_controller/railties/url_helpers.rb | 14 |
2 files changed, 14 insertions, 33 deletions
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 |