aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack
diff options
context:
space:
mode:
authorCarlhuda <carlhuda@engineyard.com>2010-02-26 17:31:32 -0800
committerCarlhuda <carlhuda@engineyard.com>2010-02-26 17:31:32 -0800
commit8689989a52fb673650c45322f060093678c6b91e (patch)
treeba9a519623b3b81fb40f4597b770a55c4c7744eb /actionpack
parent050831803a9e553ba392a73732b00528dfa8c6ad (diff)
downloadrails-8689989a52fb673650c45322f060093678c6b91e.tar.gz
rails-8689989a52fb673650c45322f060093678c6b91e.tar.bz2
rails-8689989a52fb673650c45322f060093678c6b91e.zip
Make ActionController::Routing::Routes a DeprecatedProxy
Diffstat (limited to 'actionpack')
-rw-r--r--actionpack/lib/action_controller/deprecated.rb2
-rw-r--r--actionpack/lib/action_controller/railtie.rb8
2 files changed, 7 insertions, 3 deletions
diff --git a/actionpack/lib/action_controller/deprecated.rb b/actionpack/lib/action_controller/deprecated.rb
index 6088d97abe..9f2de57033 100644
--- a/actionpack/lib/action_controller/deprecated.rb
+++ b/actionpack/lib/action_controller/deprecated.rb
@@ -1,5 +1,3 @@
ActionController::AbstractRequest = ActionController::Request = ActionDispatch::Request
ActionController::AbstractResponse = ActionController::Response = ActionDispatch::Response
ActionController::Routing = ActionDispatch::Routing
-# ROUTES TODO: Figure out how to deprecate this.
-# ActionController::UrlWriter = ActionController::UrlFor
diff --git a/actionpack/lib/action_controller/railtie.rb b/actionpack/lib/action_controller/railtie.rb
index 69ee4b04ec..07c6b8f2b6 100644
--- a/actionpack/lib/action_controller/railtie.rb
+++ b/actionpack/lib/action_controller/railtie.rb
@@ -2,6 +2,7 @@ require "rails"
require "action_controller"
require "action_view/railtie"
require "active_support/core_ext/class/subclasses"
+require "active_support/deprecation/proxy_wrappers"
module ActionController
class Railtie < Rails::Railtie
@@ -32,7 +33,12 @@ module ActionController
initializer "action_controller.url_helpers" do |app|
ActionController::Base.extend ::ActionController::Railtie::UrlHelpers.with(app.routes)
- ActionController::Routing::Routes = app.routes
+
+ message = "ActionController::Routing::Routes is deprecated. " \
+ "Instead, use Rails.application.routes"
+
+ proxy = ActiveSupport::Deprecation::DeprecatedObjectProxy.new(app.routes, message)
+ ActionController::Routing::Routes = proxy
end
end
end \ No newline at end of file