Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fix position of load hook so that Base has been defined and included …

…Model before it runs
  • Loading branch information...
commit a5fa310f406e299a1ac54d1a227bde93b7ce282b 1 parent a8dcc0b
@jonleighton jonleighton authored
View
3  activerecord/lib/active_record/base.rb
@@ -331,3 +331,6 @@ class Base
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)
View
6 activerecord/lib/active_record/model.rb
@@ -81,7 +81,7 @@ def method_missing(name, *args, &block)
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
Please sign in to comment.
Something went wrong with that request. Please try again.