diff options
author | José Valim <jose.valim@gmail.com> | 2010-07-17 10:59:41 +0200 |
---|---|---|
committer | José Valim <jose.valim@gmail.com> | 2010-07-18 11:02:07 +0200 |
commit | fa98eca75bd8666719bf3d061c87638850a20fe9 (patch) | |
tree | 8856316fd6c3bf49fc1ace113f6f62891701bc28 /activerecord/lib | |
parent | cfca55949f51bf3970bae7c506807db97dbcf05f (diff) | |
download | rails-fa98eca75bd8666719bf3d061c87638850a20fe9.tar.gz rails-fa98eca75bd8666719bf3d061c87638850a20fe9.tar.bz2 rails-fa98eca75bd8666719bf3d061c87638850a20fe9.zip |
Add console hook to force ActiveRecord::Base to be loaded when console starts avoiding reference loops.
Diffstat (limited to 'activerecord/lib')
-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 eff51a7c87..78fdb77216 100644 --- a/activerecord/lib/active_record/railtie.rb +++ b/activerecord/lib/active_record/railtie.rb @@ -22,6 +22,12 @@ module ActiveRecord load "active_record/railties/databases.rake" end + # When loading console, force ActiveRecord to be loaded to avoid cross + # references when loading a constant for the first time. + console do + ActiveRecord::Base + end + initializer "active_record.initialize_timezone" do ActiveSupport.on_load(:active_record) do self.time_zone_aware_attributes = true |