aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRick Olson <technoweenie@gmail.com>2006-12-27 22:18:38 +0000
committerRick Olson <technoweenie@gmail.com>2006-12-27 22:18:38 +0000
commit5cf118b1384bce266c76d3f4a12e761bbcb130ab (patch)
tree24a8a83701f348ec3a8c211ac8b62aaf0bc49ef2
parent810d0ade2bb04464fbbd5497b4cc092ed80fc53a (diff)
downloadrails-5cf118b1384bce266c76d3f4a12e761bbcb130ab.tar.gz
rails-5cf118b1384bce266c76d3f4a12e761bbcb130ab.tar.bz2
rails-5cf118b1384bce266c76d3f4a12e761bbcb130ab.zip
Ensure plugins are in the Dependencies.load_once_paths collection by default. [Rick]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5801 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
-rw-r--r--railties/CHANGELOG5
-rw-r--r--railties/lib/initializer.rb7
2 files changed, 8 insertions, 4 deletions
diff --git a/railties/CHANGELOG b/railties/CHANGELOG
index 06d1419368..302782c73a 100644
--- a/railties/CHANGELOG
+++ b/railties/CHANGELOG
@@ -1,5 +1,10 @@
*SVN*
+* Ensure plugins are in the Dependencies.load_once_paths collection by default. [Rick]
+ If you really want your plugins to reload, add this to the very top of init.rb:
+
+ Dependencies.load_once_paths.delete(lib_path)
+
* Allow config.to_prepare to work, make the dispatcher safe to 're require'. [Koz, Nicholas Seckar]
* Fix scaffold_resource generator so it respects the --pretend argument when creating the routes file. Closes #6852 [fearoffish]
diff --git a/railties/lib/initializer.rb b/railties/lib/initializer.rb
index c7f32d767a..6bb65d3871 100644
--- a/railties/lib/initializer.rb
+++ b/railties/lib/initializer.rb
@@ -388,6 +388,7 @@ module Rails
application_lib_index = $LOAD_PATH.index(File.join(RAILS_ROOT, "lib")) || 0
$LOAD_PATH.insert(application_lib_index + 1, lib_path)
Dependencies.load_paths << lib_path
+ Dependencies.load_once_paths << lib_path
end
# Allow plugins to reference the current configuration object
@@ -612,11 +613,9 @@ module Rails
paths.concat builtin_directories
end
+ # Doesn't matter since plugins aren't in load_paths yet.
def default_load_once_paths
- plugin_root = "#{root_path}/vendor/plugins/"
- default_load_paths.select do |path|
- path[0, plugin_root.length] == plugin_root # No begins_with yet
- end
+ []
end
def default_log_path