aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/base.rb
diff options
context:
space:
mode:
authorXavier Noria <fxn@hashref.com>2010-08-20 17:18:57 +0200
committerXavier Noria <fxn@hashref.com>2010-08-20 17:18:57 +0200
commit0c75ec51a9b60252125534b8f9a3f6406713a957 (patch)
tree34165e93f7dd01157f77e4e70a46ec6a5bed77c8 /activerecord/lib/active_record/base.rb
parent87398e531d0bb23b30787fe26d86678dba322895 (diff)
parent2ffa50f5a9fac08e08869687006031b70322497a (diff)
downloadrails-0c75ec51a9b60252125534b8f9a3f6406713a957.tar.gz
rails-0c75ec51a9b60252125534b8f9a3f6406713a957.tar.bz2
rails-0c75ec51a9b60252125534b8f9a3f6406713a957.zip
Merge remote branch 'rails/master'
Diffstat (limited to 'activerecord/lib/active_record/base.rb')
-rw-r--r--activerecord/lib/active_record/base.rb10
1 files changed, 7 insertions, 3 deletions
diff --git a/activerecord/lib/active_record/base.rb b/activerecord/lib/active_record/base.rb
index 9d3ee9528a..90241dd897 100644
--- a/activerecord/lib/active_record/base.rb
+++ b/activerecord/lib/active_record/base.rb
@@ -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}'. " +
@@ -1171,7 +1175,7 @@ MSG
if type_name.match(/^::/)
# If the type is prefixed with a scope operator then we assume that
# the type_name is an absolute reference.
- type_name.constantize
+ ActiveSupport::Dependencies.constantize(type_name)
else
# Build a list of candidates to search for
candidates = []
@@ -1180,7 +1184,7 @@ MSG
candidates.each do |candidate|
begin
- constant = candidate.constantize
+ constant = ActiveSupport::Dependencies.constantize(candidate)
return constant if candidate == constant.to_s
rescue NameError => e
# We don't want to swallow NoMethodError < NameError errors