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

Changeset 3546

Show
Ignore:
Timestamp:
02/06/06 15:38:41 (3 years ago)
Author:
madrobby
Message:

Make Upload Progress plugin work with edge Rails [3526] and higher, retain compatibility to earlier builds

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • plugins/upload_progress/lib/multipart_progress.rb

    r3424 r3546  
    123123          # Pull in the application controller to satisfy any dependencies on class definitions 
    124124          # of instances stored in the session. 
    125           Controllers.const_load!(:ApplicationController, "application") unless Controllers.const_defined?(:ApplicationController) 
     125          # Be sure to stay compatible with Rails 1.0/const_load! 
     126          if Object.const_defined?(:Controllers) and Controllers.respond_to?(:const_load!) 
     127            Controllers.const_load!(:ApplicationController, "application") unless Controllers.const_defined?(:ApplicationController) 
     128          else 
     129            require_dependency('application.rb') unless Object.const_defined?(:ApplicationController) 
     130          end 
    126131 
    127132          # Assumes that @cookies has already been setup