Skip to content

Commit

Permalink
fix for Rails 2.3.[6-8]
Browse files Browse the repository at this point in the history
  • Loading branch information
tra authored and zaius committed Aug 9, 2010
1 parent 85a95ad commit 46a0ce0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion README.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
8 changes: 5 additions & 3 deletions lib/patches.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 46a0ce0

Please sign in to comment.