Permalink
Browse files

Preload application classes. Uses same strategy as phusion passenger.

  • Loading branch information...
1 parent 0f43de6 commit 3bd34b6ffe017dd81fd26743aab052fc4324eb0f @josh josh committed Jun 14, 2008
Showing with 11 additions and 0 deletions.
  1. +11 −0 railties/lib/initializer.rb
View
11 railties/lib/initializer.rb
@@ -168,6 +168,9 @@ def process
# Observers are loaded after plugins in case Observers or observed models are modified by plugins.
load_observers
+ # load application classes
+ load_application_classes
+
# Flag initialized
Rails.initialized = true
end
@@ -330,6 +333,14 @@ def load_observers
end
end
+ def load_application_classes
+ require_dependency 'application'
+
+ Dir.glob('app/{models,controllers,helpers}/*.rb').each do |file|
+ require_dependency file
+ end
+ end
+
# For Ruby 1.8, this initialization sets $KCODE to 'u' to enable the
# multibyte safe operations. Plugin authors supporting other encodings
# should override this behaviour and set the relevant +default_charset+

0 comments on commit 3bd34b6

Please sign in to comment.