aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord
diff options
context:
space:
mode:
authorAaron Patterson <aaron.patterson@gmail.com>2013-05-16 16:06:26 -0700
committerAaron Patterson <aaron.patterson@gmail.com>2013-05-16 16:06:52 -0700
commit6062e42f982e0641de023419dc357bf1ec6b5e35 (patch)
tree2bcc18c1dc90fda187ac64cb32358a338b0c4a60 /activerecord
parent10b538c2aa1f15a1859c74644d90376b81c42645 (diff)
downloadrails-6062e42f982e0641de023419dc357bf1ec6b5e35.tar.gz
rails-6062e42f982e0641de023419dc357bf1ec6b5e35.tar.bz2
rails-6062e42f982e0641de023419dc357bf1ec6b5e35.zip
let Ruby do the is_a check for us
Diffstat (limited to 'activerecord')
-rw-r--r--activerecord/lib/active_record/inheritance.rb7
1 files changed, 4 insertions, 3 deletions
diff --git a/activerecord/lib/active_record/inheritance.rb b/activerecord/lib/active_record/inheritance.rb
index 8df76c7f5f..40976bc29e 100644
--- a/activerecord/lib/active_record/inheritance.rb
+++ b/activerecord/lib/active_record/inheritance.rb
@@ -116,9 +116,10 @@ module ActiveRecord
begin
constant = ActiveSupport::Dependencies.constantize(candidate)
return constant if candidate == constant.to_s
- rescue NameError => e
- # We don't want to swallow NoMethodError < NameError errors
- raise e unless e.instance_of?(NameError)
+ # We don't want to swallow NoMethodError < NameError errors
+ rescue NoMethodError
+ raise
+ rescue NameError
end
end