mirror of
https://github.com/github/rails.git
synced 2026-04-26 03:00:59 -04:00
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:
committed by
Aaron Patterson
parent
ae44bf7c7e
commit
f978c4b2e4
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user