remove the rescue block by returning a not asking Base for lookup_ancestors. It was also marked for later optimization.

This commit is contained in:
Neeraj Singh
2010-11-17 16:12:21 -05:00
committed by Aaron Patterson
parent ae44bf7c7e
commit f978c4b2e4

View File

@@ -736,15 +736,12 @@ module ActiveRecord #:nodoc:
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.