mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Preload application classes. Uses same strategy as phusion passenger.
This commit is contained in:
parent
0f43de644e
commit
3bd34b6ffe
1 changed files with 11 additions and 0 deletions
|
@ -168,6 +168,9 @@ module Rails
|
|||
# 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 @@ Run `rake gems:install` to install the missing gems.
|
|||
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+
|
||||
|
|
Loading…
Reference in a new issue