From ed34652d1aca148fea61c5309c1bd5ff3a55abfa Mon Sep 17 00:00:00 2001 From: wycats Date: Sat, 29 May 2010 20:07:47 +0200 Subject: 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. --- railties/lib/rails/engine.rb | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) (limited to 'railties/lib/rails/engine.rb') diff --git a/railties/lib/rails/engine.rb b/railties/lib/rails/engine.rb index b44755820c..cdb00a4eff 100644 --- a/railties/lib/rails/engine.rb +++ b/railties/lib/rails/engine.rb @@ -25,7 +25,7 @@ module Rails # end # # Then ensure that this file is loaded at the top of your config/application.rb (or in - # your Gemfile) and it will automatically load models, controllers, helpers and metals + # your Gemfile) and it will automatically load models, controllers and helpers # inside app, load routes at "config/routes.rb", load locales at "config/locales/*", # load tasks at "lib/tasks/*". # @@ -73,7 +73,6 @@ module Rails # paths.app.controllers = "app/controllers" # paths.app.helpers = "app/helpers" # paths.app.models = "app/models" - # paths.app.metals = "app/metal" # paths.app.views = "app/views" # paths.lib = "lib" # paths.lib.tasks = "lib/tasks" @@ -202,10 +201,6 @@ module Rails end end - initializer :add_metals do |app| - app.metal_loader.paths.unshift(*paths.app.metals.to_a) - end - initializer :load_config_initializers do paths.config.initializers.to_a.sort.each do |initializer| load(initializer) -- cgit v1.2.3