Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

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

…rce files. Fixes issue #359.
  • Loading branch information...
commit f9ca4cbf41d62d1c11583a1109ad9107c35b3ba8 1 parent edaa45c
Hongli Lai FooBarWidget authored
Showing with 4 additions and 2 deletions.
  1. +4 −2 lib/phusion_passenger/railz/application_spawner.rb
6 lib/phusion_passenger/railz/application_spawner.rb
View
@@ -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
Please sign in to comment.
Something went wrong with that request. Please try again.