diff options
author | David Heinemeier Hansson <david@loudthinking.com> | 2008-11-26 14:41:20 +0100 |
---|---|---|
committer | David Heinemeier Hansson <david@loudthinking.com> | 2008-11-26 14:41:20 +0100 |
commit | 63d8f56774dcb1ea601928c3eb6c119d359fae10 (patch) | |
tree | 599aa9a3307d3f3516d051532c768724b967114b /railties/lib/rails/plugin | |
parent | 133c349b0af1c46d26f83c19e6b583062db931e4 (diff) | |
download | rails-63d8f56774dcb1ea601928c3eb6c119d359fae10.tar.gz rails-63d8f56774dcb1ea601928c3eb6c119d359fae10.tar.bz2 rails-63d8f56774dcb1ea601928c3eb6c119d359fae10.zip |
Added app/[models|controllers|helpers] to the load path for plugins that has an app directory (go engines ;)) [DHH]
Diffstat (limited to 'railties/lib/rails/plugin')
-rw-r--r-- | railties/lib/rails/plugin/loader.rb | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/railties/lib/rails/plugin/loader.rb b/railties/lib/rails/plugin/loader.rb index 948d497007..8d7eac53c5 100644 --- a/railties/lib/rails/plugin/loader.rb +++ b/railties/lib/rails/plugin/loader.rb @@ -33,6 +33,7 @@ module Rails plugin.load(initializer) register_plugin_as_loaded(plugin) end + ensure_all_registered_plugins_are_loaded! end @@ -45,12 +46,15 @@ module Rails plugins.each do |plugin| plugin.load_paths.each do |path| $LOAD_PATH.insert(application_lib_index + 1, path) - ActiveSupport::Dependencies.load_paths << path + + ActiveSupport::Dependencies.load_paths << path + unless Rails.configuration.reload_plugins? ActiveSupport::Dependencies.load_once_paths << path end end end + $LOAD_PATH.uniq! end @@ -59,9 +63,9 @@ module Rails # The locate_plugins method uses each class in config.plugin_locators to # find the set of all plugins available to this Rails application. def locate_plugins - configuration.plugin_locators.map { |locator| + configuration.plugin_locators.map do |locator| locator.new(initializer).plugins - }.flatten + end.flatten # TODO: sorting based on config.plugins end |