From cc712f2072e2bfd16db83239dd163eb3a488c45e Mon Sep 17 00:00:00 2001 From: Xavier Noria Date: Sun, 29 Jul 2012 00:23:48 +0200 Subject: removes the AR session store from eager loaded code [fixes #7160] See the comment in the file activerecord/lib/active_record.rb added by this patch for the rationale. --- activerecord/lib/active_record.rb | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'activerecord') diff --git a/activerecord/lib/active_record.rb b/activerecord/lib/active_record.rb index 2463f3951f..14f2715ea4 100644 --- a/activerecord/lib/active_record.rb +++ b/activerecord/lib/active_record.rb @@ -31,6 +31,16 @@ require 'active_record/version' module ActiveRecord extend ActiveSupport::Autoload + # ActiveRecord::SessionStore depends on the abstract store in Action Pack. + # Eager loading this class would break client code that eager loads Active + # Record standalone. + # + # Note that the Rails application generator creates an initializer specific + # for setting the session store. Thus, albeit in theory this autoload would + # not be thread-safe, in practice it is because if the application uses this + # session store its autoload happens at boot time. + autoload :SessionStore + eager_autoload do autoload :ActiveRecordError, 'active_record/errors' autoload :ConnectionNotEstablished, 'active_record/errors' @@ -81,7 +91,6 @@ module ActiveRecord autoload :SchemaDumper autoload :Scoping autoload :Serialization - autoload :SessionStore autoload :Store autoload :Timestamp autoload :Transactions -- cgit v1.2.3