aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record
diff options
context:
space:
mode:
authorNeeraj Singh <neerajdotname@gmail.com>2010-11-17 16:12:21 -0500
committerAaron Patterson <aaron.patterson@gmail.com>2010-11-17 15:44:04 -0800
commitf978c4b2e44401260bbf4b5a954fda0b2bc71781 (patch)
treeda8020dbd2b0c852db5ce6ed2dc3fc6a25d3467b /activerecord/lib/active_record
parentae44bf7c7ebb39d9a12d5253016f92617bee79c7 (diff)
downloadrails-f978c4b2e44401260bbf4b5a954fda0b2bc71781.tar.gz
rails-f978c4b2e44401260bbf4b5a954fda0b2bc71781.tar.bz2
rails-f978c4b2e44401260bbf4b5a954fda0b2bc71781.zip
remove the rescue block by returning a not asking Base for lookup_ancestors. It was also marked for later optimization.
Diffstat (limited to 'activerecord/lib/active_record')
-rw-r--r--activerecord/lib/active_record/base.rb7
1 files changed, 2 insertions, 5 deletions
diff --git a/activerecord/lib/active_record/base.rb b/activerecord/lib/active_record/base.rb
index b35f59d6df..60a9ca7464 100644
--- a/activerecord/lib/active_record/base.rb
+++ b/activerecord/lib/active_record/base.rb
@@ -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.