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

Changeset 990

Show
Ignore:
Timestamp:
03/25/05 09:07:01 (3 years ago)
Author:
david
Message:

Fixed that MissingSourceFile's wasn't properly detected in production mode #925 [Nicholas Seckar]

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/actionpack/lib/action_controller/dependencies.rb

    r984 r990  
    8383        def inherited(child) 
    8484          inherited_without_model(child) 
    85           return if child.controller_name == "application" # otherwise the ApplicationController in Rails will include itself 
    86           model_name = child.controller_name.singularize 
    87           begin 
    88             require_dependency model_name 
    89             child.model model_name 
    90           rescue MissingSourceFile => e 
    91             raise unless e.path == model_name + '.rb' 
    92           end 
    9385        end         
    9486    end 
  • trunk/actionpack/lib/action_controller/helpers.rb

    r984 r990  
    9494          begin child.helper(child.controller_path) 
    9595          rescue MissingSourceFile => e 
    96             raise unless e.path == "helpers/#{child.controller_path}_helper.rb" 
     96            raise unless e.is_missing?("helpers/#{child.controller_path}_helper") 
    9797          end 
    9898        end         
  • trunk/actionwebservice/lib/action_web_service/container/action_controller_container.rb

    r984 r990  
    8787            begin child.web_service_api(child.controller_path) 
    8888            rescue MissingSourceFile => e 
    89               raise unless e.path == "apis/#{child.controller_path}_api.rb" 
     89              raise unless e.is_missing?("apis/#{child.controller_path}_api") 
    9090            end 
    9191          end 
  • trunk/activerecord/CHANGELOG

    r989 r990  
    11*SVN* 
     2 
     3* Fixed that MissingSourceFile's wasn't properly detected in production mode #925 [Nicholas Seckar] 
    24 
    35* Fixed that :counter_cache option would look for a line_items_count column for a LineItem object instead of lineitems_count 
  • trunk/activesupport/lib/active_support/core_ext/load_error.rb

    r985 r990  
    44    super(message) 
    55    @path = path 
     6  end 
     7 
     8  def is_missing?(path) 
     9    path.gsub(/\.rb$/, '') == self.path.gsub(/\.rb$/, '') 
    610  end 
    711