diff options
author | Nicholas Seckar <nseckar@gmail.com> | 2006-08-05 22:52:15 +0000 |
---|---|---|
committer | Nicholas Seckar <nseckar@gmail.com> | 2006-08-05 22:52:15 +0000 |
commit | 52d4166947d94a3648f1531239491f51cd73f2de (patch) | |
tree | c78fbaff7f9c194ba077f0f5303c4cd973973f87 /activesupport/lib/active_support/core_ext/name_error.rb | |
parent | 6ba4f4c524f73db062016701c9f93c70b08d93c0 (diff) | |
download | rails-52d4166947d94a3648f1531239491f51cd73f2de.tar.gz rails-52d4166947d94a3648f1531239491f51cd73f2de.tar.bz2 rails-52d4166947d94a3648f1531239491f51cd73f2de.zip |
Raise fully qualified names upon name errors. Closes #5533.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4681 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'activesupport/lib/active_support/core_ext/name_error.rb')
-rw-r--r-- | activesupport/lib/active_support/core_ext/name_error.rb | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/activesupport/lib/active_support/core_ext/name_error.rb b/activesupport/lib/active_support/core_ext/name_error.rb index 42b89d3d28..2b617b0083 100644 --- a/activesupport/lib/active_support/core_ext/name_error.rb +++ b/activesupport/lib/active_support/core_ext/name_error.rb @@ -9,7 +9,12 @@ class NameError < StandardError # Was this exception raised because the given name was missing? def missing_name?(name) - missing_name == name.to_s + if name.is_a? Symbol + last_name = (missing_name || '').split('::').last + last_name == name.to_s + else + missing_name == name.to_s + end end end
\ No newline at end of file |