diff options
author | David Heinemeier Hansson <david@loudthinking.com> | 2004-12-20 21:48:38 +0000 |
---|---|---|
committer | David Heinemeier Hansson <david@loudthinking.com> | 2004-12-20 21:48:38 +0000 |
commit | 6ea54a630a270c7df2c97705e231af64686d2444 (patch) | |
tree | eb34443fa47dd6c29fb834999a5a3f8aeb2bf004 /activerecord/lib | |
parent | 2e3106b617ada84a8932e80f98c5a95e088c4698 (diff) | |
download | rails-6ea54a630a270c7df2c97705e231af64686d2444.tar.gz rails-6ea54a630a270c7df2c97705e231af64686d2444.tar.bz2 rails-6ea54a630a270c7df2c97705e231af64686d2444.zip |
Deal with associated classes that doesnt reside in their own files
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@237 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'activerecord/lib')
-rwxr-xr-x | activerecord/lib/active_record/associations.rb | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/activerecord/lib/active_record/associations.rb b/activerecord/lib/active_record/associations.rb index 11dd89ae43..68a646f5c6 100755 --- a/activerecord/lib/active_record/associations.rb +++ b/activerecord/lib/active_record/associations.rb @@ -487,7 +487,13 @@ module ActiveRecord # Reload all the associations that have already been loaded once. def reload_associations_loaded - associations_loaded.each { |file_name| silence_warnings { load("#{file_name}.rb") } } + associations_loaded.each do |file_name| + begin + silence_warnings { load("#{file_name}.rb") } + rescue LoadError + # The association didn't reside in its own file, so we assume it was required by other means + end + end end private |