From 605bc77533cf3b6700e91eda8994cdf6b82341cc Mon Sep 17 00:00:00 2001 From: David Heinemeier Hansson Date: Tue, 14 Dec 2004 12:32:29 +0000 Subject: 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 --- activerecord/lib/active_record/associations.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'activerecord/lib/active_record/associations.rb') 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. -- cgit v1.2.3