From 0e9b9d59859efa46a82b56e0715784fa52656650 Mon Sep 17 00:00:00 2001 From: Andrew Bloomgarden Date: Tue, 1 Jun 2010 22:47:34 -0700 Subject: Fix ActiveRecord::Base.compute_type swallowing NoMethodError. [#4751 state:resolved] Signed-off-by: David Heinemeier Hansson --- activerecord/lib/active_record/base.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'activerecord/lib') diff --git a/activerecord/lib/active_record/base.rb b/activerecord/lib/active_record/base.rb index aa2826fb33..7cff6d9f1a 100755 --- a/activerecord/lib/active_record/base.rb +++ b/activerecord/lib/active_record/base.rb @@ -1219,7 +1219,9 @@ module ActiveRecord #:nodoc: begin constant = candidate.constantize return constant if candidate == constant.to_s - rescue NameError + rescue NameError => e + # We don't want to swallow NoMethodError < NameError errors + raise e unless e.instance_of?(NameError) rescue ArgumentError end end -- cgit v1.2.3