diff options
author | wycats <wycats@gmail.com> | 2010-05-29 20:07:47 +0200 |
---|---|---|
committer | Mikel Lindsaar <raasdnil@gmail.com> | 2010-06-03 23:32:10 +1000 |
commit | ed34652d1aca148fea61c5309c1bd5ff3a55abfa (patch) | |
tree | ee2fbf07bfca011623c928c0b24a7783925e8f88 /railties/lib/rails/application.rb | |
parent | e6b0ea3f8a252b6795156ad8c0816198f7c18cf9 (diff) | |
download | rails-ed34652d1aca148fea61c5309c1bd5ff3a55abfa.tar.gz rails-ed34652d1aca148fea61c5309c1bd5ff3a55abfa.tar.bz2 rails-ed34652d1aca148fea61c5309c1bd5ff3a55abfa.zip |
Removing Metal from Rails 3.
If you have existing Metals, you have a few options:
* if your metal behaves like a middleware, add it to the
middleware stack via config.middleware.use. You can use
methods on the middleware stack to control exactly where
it should go
* if it behaves like a Rack endpoint, you can link to it
in the router. This will result in more optimal routing
time, and allows you to remove code in your endpoint
that matches specific URLs in favor of the more powerful
handling in the router itself.
For the future, you can use ActionController::Metal to get
a very fast controller with the ability to opt-in to specific
controller features without paying the penalty of the full
controller stack.
Since Rails 3 is closer to Rack, the Metal abstraction is
no longer needed.
Diffstat (limited to 'railties/lib/rails/application.rb')
-rw-r--r-- | railties/lib/rails/application.rb | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/railties/lib/rails/application.rb b/railties/lib/rails/application.rb index a3b3a56bc8..c588a41443 100644 --- a/railties/lib/rails/application.rb +++ b/railties/lib/rails/application.rb @@ -27,7 +27,7 @@ module Rails # Besides providing the same configuration as Rails::Engine and Rails::Railtie, # the application object has several specific configurations, for example # "allow_concurrency", "cache_classes", "consider_all_requests_local", "filter_parameters", - # "logger", "metals", "reload_engines", "reload_plugins" and so forth. + # "logger", "reload_engines", "reload_plugins" and so forth. # # Check Rails::Application::Configuration to see them all. # @@ -36,17 +36,15 @@ module Rails # The application object is also responsible for holding the routes and reloading routes # whenever the files change in development. # - # == Middlewares and metals + # == Middlewares # - # The Application is also responsible for building the middleware stack and setting up - # both application and engines metals. + # The Application is also responsible for building the middleware stack. # class Application < Engine autoload :Bootstrap, 'rails/application/bootstrap' autoload :Configurable, 'rails/application/configurable' autoload :Configuration, 'rails/application/configuration' autoload :Finisher, 'rails/application/finisher' - autoload :MetalLoader, 'rails/application/metal_loader' autoload :Railties, 'rails/application/railties' autoload :RoutesReloader, 'rails/application/routes_reloader' @@ -83,7 +81,7 @@ module Rails end end - delegate :middleware, :metal_loader, :to => :config + delegate :middleware, :to => :config def require_environment! environment = paths.config.environment.to_a.first |