Ruby on Rails | Screencasts | Download | Documentation | Weblog | Community | Source

Changeset 5792

Show
Ignore:
Timestamp:
12/26/06 23:56:00 (2 years ago)
Author:
nzkoz
Message:

Allow config.to_prepare to work, make the dispatcher safe to 're require'. [Koz, Nicholas Seckar]

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/railties/CHANGELOG

    r5790 r5792  
    11*SVN* 
     2 
     3* Allow config.to_prepare to work, make the dispatcher safe to 're require'. [Koz, Nicholas Seckar] 
    24 
    35* Fix scaffold_resource generator so it respects the --pretend argument when creating the routes file.  Closes #6852 [fearoffish] 
  • trunk/railties/lib/dispatcher.rb

    r5658 r5792  
    164164  end 
    165165   
    166   self.preparation_callbacks = [] 
     166  self.preparation_callbacks ||= [] 
    167167  self.preparation_callbacks_run = false 
    168168   
  • trunk/railties/lib/initializer.rb

    r5738 r5792  
    552552    # See Dispatcher#to_prepare. 
    553553    def to_prepare(&callback) 
     554      require 'dispatcher' unless defined?(::Dispatcher) 
    554555      Dispatcher.to_prepare(&callback) 
    555556    end