Skip to content

Commit

Permalink
Optimize find_sti_class when store_full_sti_class is true
Browse files Browse the repository at this point in the history
[#5403]

Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
  • Loading branch information
pixeltrix authored and jeremy committed Aug 19, 2010
1 parent 8f2b278 commit ad06326
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion activerecord/lib/active_record/base.rb
Expand Up @@ -918,7 +918,11 @@ def find_sti_class(type_name)
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}'. " +
Expand Down

0 comments on commit ad06326

Please sign in to comment.