mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Optimize find_sti_class when store_full_sti_class is true
[#5403] Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
This commit is contained in:
parent
de0f47afb2
commit
0b73f2af0e
1 changed files with 5 additions and 1 deletions
|
@ -918,7 +918,11 @@ module ActiveRecord #:nodoc:
|
|||
self
|
||||
else
|
||||
begin
|
||||
compute_type(type_name)
|
||||
if store_full_sti_class
|
||||
ActiveSupport::Dependencies.constantize(type_name)
|
||||
else
|
||||
compute_type(type_name)
|
||||
end
|
||||
rescue NameError
|
||||
raise SubclassNotFound,
|
||||
"The single-table inheritance mechanism failed to locate the subclass: '#{type_name}'. " +
|
||||
|
|
Loading…
Reference in a new issue