Permalink
Browse files

When preloading a Rails application, enforce a load order for the sou…

…rce files. Fixes issue #359.
  • Loading branch information...
1 parent edaa45c commit f9ca4cbf41d62d1c11583a1109ad9107c35b3ba8 @FooBarWidget FooBarWidget committed Aug 23, 2009
Showing with 4 additions and 2 deletions.
  1. +4 −2 lib/phusion_passenger/railz/application_spawner.rb
@@ -322,8 +322,10 @@ def load_environment_with_passenger
# - Rails >= 2.2 already preloads application sources by default, so no need
# to do that again.
if GC.copy_on_write_friendly? && !::Rails::Initializer.method_defined?(:load_application_classes)
- Dir.glob('app/{models,controllers,helpers}/*.rb').each do |file|
- require_dependency canonicalize_path(file)
+ ['models','controllers','helpers'].each do |section|
+ Dir.glob("app/#{section}}/*.rb").each do |file|
+ require_dependency canonicalize_path(file)
+ end
end
end
end

0 comments on commit f9ca4cb

Please sign in to comment.