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:
parent
10b538c2aa
commit
6062e42f98
1 changed files with 4 additions and 3 deletions
|
@ -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
|
||||
|
||||
|
|
Loading…
Reference in a new issue