diff options
author | Jon Leighton <j@jonathanleighton.com> | 2011-12-24 12:30:10 +0000 |
---|---|---|
committer | Jon Leighton <j@jonathanleighton.com> | 2011-12-24 12:30:17 +0000 |
commit | a5fa310f406e299a1ac54d1a227bde93b7ce282b (patch) | |
tree | 2d9462ad98f6c39658cfa151c9145e7a71dad310 /activerecord/lib/active_record | |
parent | a8dcc0b18e038450d2e2411af35b762b16191af8 (diff) | |
download | rails-a5fa310f406e299a1ac54d1a227bde93b7ce282b.tar.gz rails-a5fa310f406e299a1ac54d1a227bde93b7ce282b.tar.bz2 rails-a5fa310f406e299a1ac54d1a227bde93b7ce282b.zip |
Fix position of load hook so that Base has been defined and included Model before it runs
Diffstat (limited to 'activerecord/lib/active_record')
-rw-r--r-- | activerecord/lib/active_record/base.rb | 3 | ||||
-rw-r--r-- | activerecord/lib/active_record/model.rb | 6 |
2 files changed, 6 insertions, 3 deletions
diff --git a/activerecord/lib/active_record/base.rb b/activerecord/lib/active_record/base.rb index 7b5544a9cb..6085df7d9f 100644 --- a/activerecord/lib/active_record/base.rb +++ b/activerecord/lib/active_record/base.rb @@ -331,3 +331,6 @@ module ActiveRecord #:nodoc: self.connection_handler = ConnectionAdapters::ConnectionHandler.new end end + +require 'active_record/connection_adapters/abstract/connection_specification' +ActiveSupport.run_load_hooks(:active_record, ActiveRecord::Model::DeprecationProxy) diff --git a/activerecord/lib/active_record/model.rb b/activerecord/lib/active_record/model.rb index 2801938729..44051f1a71 100644 --- a/activerecord/lib/active_record/model.rb +++ b/activerecord/lib/active_record/model.rb @@ -81,7 +81,7 @@ module ActiveRecord end end end -end -require 'active_record/connection_adapters/abstract/connection_specification' -ActiveSupport.run_load_hooks(:active_record, ActiveRecord::Model::DeprecationProxy) + # Load Base at this point, because the active_record load hook is run in that file. + Base +end |