aboutsummaryrefslogtreecommitdiffstats
path: root/railties/lib/initializer.rb
diff options
context:
space:
mode:
authorDavid Heinemeier Hansson <david@loudthinking.com>2007-09-21 22:31:19 +0000
committerDavid Heinemeier Hansson <david@loudthinking.com>2007-09-21 22:31:19 +0000
commit6dd10d85dab9d2623deb3dc4a61106ca9be1d981 (patch)
tree7180753dbf40f804418b983f542d66b3fb3c5e1b /railties/lib/initializer.rb
parent83c17f208933bb895faf9a18194f8a407c194f05 (diff)
downloadrails-6dd10d85dab9d2623deb3dc4a61106ca9be1d981.tar.gz
rails-6dd10d85dab9d2623deb3dc4a61106ca9be1d981.tar.bz2
rails-6dd10d85dab9d2623deb3dc4a61106ca9be1d981.zip
Added the :all option to config.plugins thatll include the rest of the plugins not already explicitly named (closes #9613) [fcheung]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7531 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'railties/lib/initializer.rb')
-rw-r--r--railties/lib/initializer.rb7
1 files changed, 5 insertions, 2 deletions
diff --git a/railties/lib/initializer.rb b/railties/lib/initializer.rb
index 4339c4b996..111b5237ba 100644
--- a/railties/lib/initializer.rb
+++ b/railties/lib/initializer.rb
@@ -177,6 +177,9 @@ module Rails
# If an array of plugin names is specified in config.plugins, only those plugins will be loaded
# and they plugins will be loaded in that order. Otherwise, plugins are loaded in alphabetical
# order.
+ #
+ # if config.plugins ends contains :all then the named plugins will be loaded in the given order and all other
+ # plugins will be loaded in alphabetical order
def load_plugins
configuration.plugin_locators.each do |locator|
locator.new(self).each do |plugin|
@@ -339,8 +342,8 @@ module Rails
private
def ensure_all_registered_plugins_are_loaded!
unless configuration.plugins.nil?
- unless loaded_plugins == configuration.plugins
- missing_plugins = configuration.plugins - loaded_plugins
+ if configuration.plugins.detect {|plugin| plugin != :all && !loaded_plugins.include?( plugin)}
+ missing_plugins = configuration.plugins - (loaded_plugins + [:all])
raise LoadError, "Could not locate the following plugins: #{missing_plugins.to_sentence}"
end
end