1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

let Ruby do the is_a check for us

This commit is contained in:
Aaron Patterson 2013-05-16 16:06:26 -07:00
parent 10b538c2aa
commit 6062e42f98

View file

@ -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