diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2013-05-16 16:06:26 -0700 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2013-05-16 16:06:52 -0700 |
commit | 6062e42f982e0641de023419dc357bf1ec6b5e35 (patch) | |
tree | 2bcc18c1dc90fda187ac64cb32358a338b0c4a60 | |
parent | 10b538c2aa1f15a1859c74644d90376b81c42645 (diff) | |
download | rails-6062e42f982e0641de023419dc357bf1ec6b5e35.tar.gz rails-6062e42f982e0641de023419dc357bf1ec6b5e35.tar.bz2 rails-6062e42f982e0641de023419dc357bf1ec6b5e35.zip |
let Ruby do the is_a check for us
-rw-r--r-- | activerecord/lib/active_record/inheritance.rb | 7 |
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 |