diff options
author | Michael Koziarski <michael@koziarski.com> | 2006-12-26 23:56:00 +0000 |
---|---|---|
committer | Michael Koziarski <michael@koziarski.com> | 2006-12-26 23:56:00 +0000 |
commit | c6d47806bf707b7fea6b2732fd690d1bdd4ac317 (patch) | |
tree | b2b5207689e5b13737e774b0368162a7c10f9c9b /railties/lib | |
parent | 29ec023adde3bf174f4f256d1ca34b68c7a1502a (diff) | |
download | rails-c6d47806bf707b7fea6b2732fd690d1bdd4ac317.tar.gz rails-c6d47806bf707b7fea6b2732fd690d1bdd4ac317.tar.bz2 rails-c6d47806bf707b7fea6b2732fd690d1bdd4ac317.zip |
Allow config.to_prepare to work, make the dispatcher safe to 're require'. [Koz, Nicholas Seckar]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5792 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'railties/lib')
-rw-r--r-- | railties/lib/dispatcher.rb | 2 | ||||
-rw-r--r-- | railties/lib/initializer.rb | 1 |
2 files changed, 2 insertions, 1 deletions
diff --git a/railties/lib/dispatcher.rb b/railties/lib/dispatcher.rb index 31eb5d2317..b0ddd29cd3 100644 --- a/railties/lib/dispatcher.rb +++ b/railties/lib/dispatcher.rb @@ -163,7 +163,7 @@ class Dispatcher end end - self.preparation_callbacks = [] + self.preparation_callbacks ||= [] self.preparation_callbacks_run = false end diff --git a/railties/lib/initializer.rb b/railties/lib/initializer.rb index 5b529ffc3d..c7f32d767a 100644 --- a/railties/lib/initializer.rb +++ b/railties/lib/initializer.rb @@ -551,6 +551,7 @@ module Rails # # See Dispatcher#to_prepare. def to_prepare(&callback) + require 'dispatcher' unless defined?(::Dispatcher) Dispatcher.to_prepare(&callback) end |