Created
May 14, 2011 02:34
-
-
Save AquaGeek/971791 to your computer and use it in GitHub Desktop.
Rails Lighthouse ticket #6493
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
From b817947827a60e2756e45ea17d7d8212f09d58ae Mon Sep 17 00:00:00 2001 | |
From: Ludo van den Boom <ludo@cubicphuse.nl> | |
Date: Tue, 1 Mar 2011 16:18:31 +0100 | |
Subject: [PATCH] Add rake_tasks hook to force ActiveRecord::Base to be loaded when executing rake task avoiding reference loops. | |
--- | |
activerecord/lib/active_record/railtie.rb | 4 ++++ | |
1 files changed, 4 insertions(+), 0 deletions(-) | |
diff --git a/activerecord/lib/active_record/railtie.rb b/activerecord/lib/active_record/railtie.rb | |
index cace6f0..a4c1b78 100644 | |
--- a/activerecord/lib/active_record/railtie.rb | |
+++ b/activerecord/lib/active_record/railtie.rb | |
@@ -24,6 +24,10 @@ module ActiveRecord | |
rake_tasks do | |
load "active_record/railties/databases.rake" | |
+ | |
+ # When loading rake tasks, force ActiveRecord to be loaded to avoid cross | |
+ # references when loading a constant for the first time. | |
+ ActiveRecord::Base | |
end | |
# When loading console, force ActiveRecord to be loaded to avoid cross | |
-- | |
1.7.4.1 | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment