Make ActionController::Routing::Routes a DeprecatedProxy

This commit is contained in:
Carlhuda 2010-02-26 17:31:32 -08:00
parent 050831803a
commit 8689989a52
2 changed files with 7 additions and 3 deletions

View File

@ -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

View File

@ -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