Skip to content
Browse files

uses_component_template_root looks at caller[0] which turns up the de…

…precation method rather than the controller. Use caller[1] instead.

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5631 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
  • Loading branch information...
1 parent 1d564d9 commit ba1db2de63b022b53cc2569fc89a6617824b0415 @jeremy jeremy committed Nov 26, 2006
Showing with 3 additions and 2 deletions.
  1. +1 −1 actionpack/lib/action_controller/components.rb
  2. +2 −1 actionpack/test/controller/components_test.rb
View
2 actionpack/lib/action_controller/components.rb
@@ -75,7 +75,7 @@ def process_with_components(request, response, parent_controller = nil) #:nodoc:
# will also use /code/weblog/components as template root
# and find templates in /code/weblog/components/admin/parties/users/
def uses_component_template_root
- path_of_calling_controller = File.dirname(caller[0].split(/:\d+:/, 2).first)
+ path_of_calling_controller = File.dirname(caller[1].split(/:\d+:/, 2).first)
path_of_controller_root = path_of_calling_controller.sub(/#{Regexp.escape(File.dirname(controller_path))}$/, "")
self.template_root = path_of_controller_root
View
3 actionpack/test/controller/components_test.rb
@@ -134,7 +134,8 @@ module C
class NestedController < ActionController::Base
# Stub for uses_component_template_root
def self.caller
- ['./test/fixtures/a/b/c/nested_controller.rb']
+ [ '/path/to/active_support/deprecation.rb:93:in `uses_component_template_root',
+ './test/fixtures/a/b/c/nested_controller.rb' ]
end
end
end

0 comments on commit ba1db2d

Please sign in to comment.
Something went wrong with that request. Please try again.