Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

fix for Rails 2.3.[6-8]

  • Loading branch information...
commit 8389758f837734488b5dbc784078eadd5619344f 1 parent 5dd9c32
@tra authored
Showing with 6 additions and 4 deletions.
  1. +1 −1  README.markdown
  2. +5 −3 lib/patches.rb
View
2  README.markdown
@@ -183,7 +183,7 @@ including:
- Ahmed Adam, Tristan Schneiter, Scott Haug, Andrew Garfield, Eugene Otto, Dan Sharp,
Olivier Ruffin, Adrian Duyzer, Cyrille Labesse
-- Garry Tan, Matt Jankowski (Rails 2.2.x fixes)
+- Garry Tan, Matt Jankowski (Rails 2.2.x fixes), Mina Naguib (Rails 2.3.6 fix)
- Tim Kadom, Mauricio Marcon Zaffari, Danial Pearce, Hongli Lai, Scott Wadden
(passenger fixes)
View
8 lib/patches.rb
@@ -3,9 +3,11 @@ class ActiveRecord::Base
# reconnect without disconnecting
if Spawn::RAILS_2_2
def self.spawn_reconnect(klass=self)
- # keep ancestors' connection_handlers around to avoid them being garbage collected
- (@@ancestor_connection_handlers ||= []) << @@connection_handler
- @@connection_handler = ActiveRecord::ConnectionAdapters::ConnectionHandler.new
+ # keep ancestors' connection_handlers around to avoid them being garbage collected in the forked child
+ @@ancestor_connection_handlers ||= []
+ @@ancestor_connection_handlers << self.connection_handler
+ self.connection_handler = ActiveRecord::ConnectionAdapters::ConnectionHandler.new
+
establish_connection
end
else
Please sign in to comment.
Something went wrong with that request. Please try again.