mirror of
https://github.com/github/rails.git
synced 2026-04-26 03:00:59 -04: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:
committed by
Jeremy Kemper
parent
8f2b2781b0
commit
ad063263bc
@@ -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}'. " +
|
||||
|
||||
Reference in New Issue
Block a user