Skip to content
This repository
Browse code

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.
  • Loading branch information...
commit cc712f2072e2bfd16db83239dd163eb3a488c45e 1 parent be408d6
Xavier Noria authored July 29, 2012

Showing 1 changed file with 10 additions and 1 deletion. Show diff stats Hide diff stats

  1. 11  activerecord/lib/active_record.rb
11  activerecord/lib/active_record.rb
@@ -31,6 +31,16 @@
31 31
 module ActiveRecord
32 32
   extend ActiveSupport::Autoload
33 33
 
  34
+  # ActiveRecord::SessionStore depends on the abstract store in Action Pack.
  35
+  # Eager loading this class would break client code that eager loads Active
  36
+  # Record standalone.
  37
+  #
  38
+  # Note that the Rails application generator creates an initializer specific
  39
+  # for setting the session store. Thus, albeit in theory this autoload would
  40
+  # not be thread-safe, in practice it is because if the application uses this
  41
+  # session store its autoload happens at boot time.
  42
+  autoload :SessionStore
  43
+
34 44
   eager_autoload do
35 45
     autoload :ActiveRecordError, 'active_record/errors'
36 46
     autoload :ConnectionNotEstablished, 'active_record/errors'
@@ -81,7 +91,6 @@ module ActiveRecord
81 91
     autoload :SchemaDumper
82 92
     autoload :Scoping
83 93
     autoload :Serialization
84  
-    autoload :SessionStore
85 94
     autoload :Store
86 95
     autoload :Timestamp
87 96
     autoload :Transactions

0 notes on commit cc712f2

Please sign in to comment.
Something went wrong with that request. Please try again.