diff options
author | David Heinemeier Hansson <david@loudthinking.com> | 2004-12-14 12:32:29 +0000 |
---|---|---|
committer | David Heinemeier Hansson <david@loudthinking.com> | 2004-12-14 12:32:29 +0000 |
commit | 605bc77533cf3b6700e91eda8994cdf6b82341cc (patch) | |
tree | 687a1c7e3bd319be5c0a6090dea190d6a8778658 /activerecord/lib/active_record/associations.rb | |
parent | 317f13c2a8c047b3868a58e0121453b092557dba (diff) | |
download | rails-605bc77533cf3b6700e91eda8994cdf6b82341cc.tar.gz rails-605bc77533cf3b6700e91eda8994cdf6b82341cc.tar.bz2 rails-605bc77533cf3b6700e91eda8994cdf6b82341cc.zip |
Added a better exception for when a type column is used in a table without the intention of triggering single-table inheritance. Added that single-table inheritance will only kick in if the inheritance_column (by default "type") is present. Otherwise, inheritance wont have any magic side effects
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@149 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'activerecord/lib/active_record/associations.rb')
-rwxr-xr-x | activerecord/lib/active_record/associations.rb | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/activerecord/lib/active_record/associations.rb b/activerecord/lib/active_record/associations.rb index c51210ef1f..ba7f34d729 100755 --- a/activerecord/lib/active_record/associations.rb +++ b/activerecord/lib/active_record/associations.rb @@ -581,7 +581,9 @@ module ActiveRecord end def require_association_class(class_name) - begin + return unless class_name + + begin require_association(Inflector.underscore(class_name)) rescue LoadError # Failed to load the associated class -- let's hope the developer is doing the requiring himself. |