From 3a5d922f67e3d3c0b9f1ee2c2293b70e4723d91c Mon Sep 17 00:00:00 2001 From: Simon Jefford Date: Fri, 6 Mar 2009 14:44:46 +0000 Subject: Updated the Rails on Rack section concerning metal - Explained how to override the default load order of metal apps - Explained that metal apps within plugins will also be loaded --- railties/guides/source/rails_on_rack.textile | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'railties/guides/source') diff --git a/railties/guides/source/rails_on_rack.textile b/railties/guides/source/rails_on_rack.textile index e300e047b4..a187e90742 100644 --- a/railties/guides/source/rails_on_rack.textile +++ b/railties/guides/source/rails_on_rack.textile @@ -226,6 +226,8 @@ class Poller end +Metal applications within +app/metal+ folders in plugins will also be discovered and added to the list + Metal applications are an optimization. You should make sure to "understand the related performance implications":http://weblog.rubyonrails.org/2008/12/20/performance-of-rails-metal before using it. h4. Execution Order @@ -244,7 +246,15 @@ def call(env) end -In the code above, +@metals+ is an ordered ( alphabetical ) hash of metal applications. Due to the alphabetical ordering, +aaa.rb+ will come before +bbb.rb+ in the metal chain. +In the code above, +@metals+ is an ordered hash of metal applications. Due to the default alphabetical ordering, +aaa.rb+ will come before +bbb.rb+ in the metal chain. + +It is, however, possible to override the default ordering in your environment. Simply add a line like the following to +config/environment.rb+ + + +config.metals = ["Bbb", "Aaa"] + + +Each string in the array should be the name of your metal class. If you do this then be warned that any metal applications not listed will not be loaded. WARNING: Metal applications cannot return the HTTP Status +404+ to a client, as it is used for continuing the Metal chain execution. Please use normal Rails controllers or a custom middleware if returning +404+ is a requirement. -- cgit v1.2.3