Permalink
Browse files

remove the rescue block by returning a not asking Base for lookup_anc…

…estors. It was also marked for later optimization.
  • Loading branch information...
1 parent ae44bf7 commit f978c4b2e44401260bbf4b5a954fda0b2bc71781 Neeraj Singh committed with tenderlove Nov 17, 2010
Showing with 2 additions and 5 deletions.
  1. +2 −5 activerecord/lib/active_record/base.rb
@@ -736,15 +736,12 @@ def attribute_method?(attribute)
def lookup_ancestors #:nodoc:
klass = self
classes = [klass]
+ return classes if klass == ActiveRecord::Base
+
while klass != klass.base_class
classes << klass = klass.superclass
end
classes
- rescue
- # OPTIMIZE this rescue is to fix this test: ./test/cases/reflection_test.rb:56:in `test_human_name_for_column'
- # Apparently the method base_class causes some trouble.
- # It now works for sure.
- [self]
end
# Set the i18n scope to overwrite ActiveModel.

0 comments on commit f978c4b

Please sign in to comment.