From a5fa310f406e299a1ac54d1a227bde93b7ce282b Mon Sep 17 00:00:00 2001 From: Jon Leighton Date: Sat, 24 Dec 2011 12:30:10 +0000 Subject: [PATCH] Fix position of load hook so that Base has been defined and included Model before it runs --- activerecord/lib/active_record/base.rb | 3 +++ 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