diff options
author | Jeremy Kemper <jeremy@bitsweat.net> | 2007-05-31 19:07:57 +0000 |
---|---|---|
committer | Jeremy Kemper <jeremy@bitsweat.net> | 2007-05-31 19:07:57 +0000 |
commit | 6435ecc68ab76ed73b5a0ae84bb325e7d7cd486d (patch) | |
tree | 6d17feaa361466253c56dee54151de917dd23f7c /actionpack/lib/action_controller | |
parent | d0360a4d5c024c85ecdd7a4eca72256712c4f9d3 (diff) | |
download | rails-6435ecc68ab76ed73b5a0ae84bb325e7d7cd486d.tar.gz rails-6435ecc68ab76ed73b5a0ae84bb325e7d7cd486d.tar.bz2 rails-6435ecc68ab76ed73b5a0ae84bb325e7d7cd486d.zip |
Missing helper load error shouldn't shadow load errors within the helper itself.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6914 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'actionpack/lib/action_controller')
-rw-r--r-- | actionpack/lib/action_controller/helpers.rb | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/actionpack/lib/action_controller/helpers.rb b/actionpack/lib/action_controller/helpers.rb index af5b2fc64c..3867329e29 100644 --- a/actionpack/lib/action_controller/helpers.rb +++ b/actionpack/lib/action_controller/helpers.rb @@ -78,8 +78,12 @@ module ActionController #:nodoc: 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) |