Skip to content
Browse files

Optimize find_sti_class when store_full_sti_class is true

[#5403]

Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
  • Loading branch information...
1 parent 8f2b278 commit ad063263bcaffb97f3e8d625d24c19d51b95b839 @pixeltrix pixeltrix committed with jeremy Aug 19, 2010
Showing with 5 additions and 1 deletion.
  1. +5 −1 activerecord/lib/active_record/base.rb
View
6 activerecord/lib/active_record/base.rb
@@ -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}'. " +

0 comments on commit ad06326

Please sign in to comment.
Something went wrong with that request. Please try again.