aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord
diff options
context:
space:
mode:
authorDavid Heinemeier Hansson <david@loudthinking.com>2004-12-20 21:48:38 +0000
committerDavid Heinemeier Hansson <david@loudthinking.com>2004-12-20 21:48:38 +0000
commit6ea54a630a270c7df2c97705e231af64686d2444 (patch)
treeeb34443fa47dd6c29fb834999a5a3f8aeb2bf004 /activerecord
parent2e3106b617ada84a8932e80f98c5a95e088c4698 (diff)
downloadrails-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')
-rwxr-xr-xactiverecord/lib/active_record/associations.rb8
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