1
0
Fork 0
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:
Andrew White 2010-08-19 21:48:19 +01:00 committed by Jeremy Kemper
parent de0f47afb2
commit 0b73f2af0e

View file

@ -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}'. " +