diff options
author | kennyj <kennyj@gmail.com> | 2012-05-29 23:31:27 +0900 |
---|---|---|
committer | Ben Holley <benolee@gmail.com> | 2012-12-16 00:06:43 -0600 |
commit | 38af3540ae53b9f2fbdb649a68cde3edf182fe67 (patch) | |
tree | 98ce599950855ef8e08d8aef7f7cf2769f478a8f /activerecord/lib/active_record/railtie.rb | |
parent | df048b574b5ab5a449a3b1dfc50dbf3baa18869e (diff) | |
download | rails-38af3540ae53b9f2fbdb649a68cde3edf182fe67.tar.gz rails-38af3540ae53b9f2fbdb649a68cde3edf182fe67.tar.bz2 rails-38af3540ae53b9f2fbdb649a68cde3edf182fe67.zip |
backport runner fixes to 3-2-stable
Add a runner hook to Rails::Application and Rails::Engine that requires
ActiveRecord::Base to avoid circular constant loading when using observers.
This commit backports cc7dd66, c0ba0f0 and 8d01c61.
Diffstat (limited to 'activerecord/lib/active_record/railtie.rb')
-rw-r--r-- | activerecord/lib/active_record/railtie.rb | 6 |
1 files changed, 6 insertions, 0 deletions
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 |