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

Changeset 5631

Show
Ignore:
Timestamp:
11/26/06 01:24:10 (2 years ago)
Author:
bitsweat
Message:

uses_component_template_root looks at caller[0] which turns up the deprecation method rather than the controller. Use caller[1] instead.

Files:

Legend:

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

    r5536 r5631  
    7676      #     and find templates in /code/weblog/components/admin/parties/users/ 
    7777      def uses_component_template_root 
    78         path_of_calling_controller = File.dirname(caller[0].split(/:\d+:/, 2).first) 
     78        path_of_calling_controller = File.dirname(caller[1].split(/:\d+:/, 2).first) 
    7979        path_of_controller_root    = path_of_calling_controller.sub(/#{Regexp.escape(File.dirname(controller_path))}$/, "") 
    8080 
  • trunk/actionpack/test/controller/components_test.rb

    r5536 r5631  
    135135        # Stub for uses_component_template_root 
    136136        def self.caller 
    137           ['./test/fixtures/a/b/c/nested_controller.rb'] 
     137          [ '/path/to/active_support/deprecation.rb:93:in `uses_component_template_root', 
     138            './test/fixtures/a/b/c/nested_controller.rb' ] 
    138139        end 
    139140      end