aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord
diff options
context:
space:
mode:
authorRafael Mendonça França <rafaelmfranca@gmail.com>2013-05-12 15:13:47 -0300
committerRafael Mendonça França <rafaelmfranca@gmail.com>2013-05-12 15:13:47 -0300
commit442b7c8ccfe107e05b309e1ef72b760716fa4cba (patch)
treec2d1e318f1c1716ee3b770dd0508624447e67995 /activerecord
parent5919a552e4e4203b8d5eb5234428bc00dd462c49 (diff)
parent38af3540ae53b9f2fbdb649a68cde3edf182fe67 (diff)
downloadrails-442b7c8ccfe107e05b309e1ef72b760716fa4cba.tar.gz
rails-442b7c8ccfe107e05b309e1ef72b760716fa4cba.tar.bz2
rails-442b7c8ccfe107e05b309e1ef72b760716fa4cba.zip
Merge pull request #7695 from benolee/backport_cc7dd66_and_c0ba0f0
backport runner fixes to 3-2-stable Conflicts: railties/CHANGELOG.md
Diffstat (limited to 'activerecord')
-rw-r--r--activerecord/CHANGELOG.md5
-rw-r--r--activerecord/lib/active_record/railtie.rb6
2 files changed, 10 insertions, 1 deletions
diff --git a/activerecord/CHANGELOG.md b/activerecord/CHANGELOG.md
index aa561bb8d3..e74ed62888 100644
--- a/activerecord/CHANGELOG.md
+++ b/activerecord/CHANGELOG.md
@@ -1,10 +1,13 @@
## unreleased ##
+* Require ActiveRecord::Base in railtie hooks for rake_tasks, console and runner to
+ avoid circular constant loading issues. [Backport #7695] [Fixes #7683 and #882] *Ben Holley*
+
* Maintain context for joins within ActiveRecord::Relation merges.
Backport #10164.
*Neeraj Singh + Andrew Horner*
-
+
* Make sure the `EXPLAIN` command is never triggered by a `select_db` call.
*Daniel Schierbeck*
diff --git a/activerecord/lib/active_record/railtie.rb b/activerecord/lib/active_record/railtie.rb
index 13b7c6e214..4e39654e5b 100644
--- a/activerecord/lib/active_record/railtie.rb
+++ b/activerecord/lib/active_record/railtie.rb
@@ -30,6 +30,7 @@ module ActiveRecord
)
rake_tasks do
+ require "active_record/base"
load "active_record/railties/databases.rake"
end
@@ -38,9 +39,14 @@ module ActiveRecord
# first time. Also, make it output to STDERR.
console do |app|
require "active_record/railties/console_sandbox" if app.sandbox?
+ require "active_record/base"
ActiveRecord::Base.logger = Logger.new(STDERR)
end
+ runner do |app|
+ require "active_record/base"
+ end
+
initializer "active_record.initialize_timezone" do
ActiveSupport.on_load(:active_record) do
self.time_zone_aware_attributes = true