mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
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
This commit is contained in:
parent
810d0ade2b
commit
5cf118b138
2 changed files with 8 additions and 4 deletions
|
@ -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]
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue