Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Missing helper load error shouldn't shadow load errors within the hel…

…per itself.

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6914 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
  • Loading branch information...
commit 6435ecc68ab76ed73b5a0ae84bb325e7d7cd486d 1 parent d0360a4
@jeremy jeremy authored
Showing with 6 additions and 2 deletions.
  1. +6 −2 actionpack/lib/action_controller/helpers.rb
View
8 actionpack/lib/action_controller/helpers.rb
@@ -78,8 +78,12 @@ def helper(*args, &block)
require_dependency(file_name)
rescue LoadError => load_error
requiree = / -- (.*?)(\.rb)?$/.match(load_error).to_a[1]
- msg = (requiree == file_name) ? "Missing helper file helpers/#{file_name}.rb" : "Can't load file: #{requiree}"
- raise LoadError.new(msg).copy_blame!(load_error)
+ if requiree == file_name
+ msg = "Missing helper file helpers/#{file_name}.rb"
+ raise LoadError.new(msg).copy_blame!(load_error)
+ else
+ raise
+ end
end
add_template_helper(class_name.constantize)
Please sign in to comment.
Something went wrong with that request. Please try again.