aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib
diff options
context:
space:
mode:
authorXavier Noria <fxn@hashref.com>2012-07-29 00:23:48 +0200
committerXavier Noria <fxn@hashref.com>2012-07-29 00:23:48 +0200
commit8bf1088d7d9a0ca46ce8e167da4130044ebf1d0c (patch)
tree983f69cb34384f61cfa9bcecd91a08bc8fed4dd9 /activerecord/lib
parent4d87c4e2f9b407f3cc7a8d2e53c2cdbcf41ae30f (diff)
downloadrails-8bf1088d7d9a0ca46ce8e167da4130044ebf1d0c.tar.gz
rails-8bf1088d7d9a0ca46ce8e167da4130044ebf1d0c.tar.bz2
rails-8bf1088d7d9a0ca46ce8e167da4130044ebf1d0c.zip
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.
Diffstat (limited to 'activerecord/lib')
-rw-r--r--activerecord/lib/active_record.rb11
1 files changed, 10 insertions, 1 deletions
diff --git a/activerecord/lib/active_record.rb b/activerecord/lib/active_record.rb
index 8526e224da..bedf37e1df 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'
@@ -83,7 +93,6 @@ module ActiveRecord
autoload :SchemaMigration
autoload :Scoping
autoload :Serialization
- autoload :SessionStore
autoload :Store
autoload :Timestamp
autoload :Transactions