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

Changeset 2218

Show
Ignore:
Timestamp:
09/12/05 14:41:51 (3 years ago)
Author:
ulysses
Message:

Fixed dependencies related infinite recursion bug when a controller file does not contain a controller class. Closes #1760.

Files:

Legend:

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

    r2214 r2218  
    11*SVN* 
     2 
     3* Fixed dependencies related infinite recursion bug when a controller file does not contain a controller class. Closes #1760. [rcolli2@tampabay.rr.com] 
    24 
    35* Fixed inflections for status, quiz, move #2056 [deirdre@deirdre.net] 
  • trunk/activesupport/lib/active_support/dependencies.rb

    r1761 r2218  
    9494          break 
    9595        when File.file?(fs_path) 
    96           self.root.load_file!(fs_path) 
     96          loaded_file = self.root.load_file!(fs_path) 
    9797           
    9898          # Import the loaded constant from Object provided we are the root node. 
    9999          self.const_set(name, Object.const_get(name)) if self.root? && Object.const_defined?(name) 
     100           
     101          # Throw an error if we load the file but we don't find the Object we expect 
     102          if loaded_file and not self.const_defined?(name) 
     103            msg = "Already loaded file '#{fs_path}' but '#{name.to_s}' was not set, perhaps you need to rename '#{fs_path}'?" 
     104            raise LoadError, msg 
     105          end 
    100106          break 
    101107        end