Skip to content

Commit

Permalink
Correctly clear ActiveRecord connections for Rails <= 2.2.
Browse files Browse the repository at this point in the history
  • Loading branch information
FooBarWidget committed Jan 8, 2010
1 parent c674aab commit d5e164f
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/phusion_passenger/railz/application_spawner.rb
Expand Up @@ -373,6 +373,8 @@ def start_request_handler(channel, forked)
if defined?(::ActiveRecord::Base)
if ::ActiveRecord::Base.respond_to?(:clear_all_connections!)
::ActiveRecord::Base.clear_all_connections!
elsif ::ActiveRecord::Base.respond_to?(:clear_active_connections!)
::ActiveRecord::Base.clear_active_connections!
elsif ::ActiveRecord::Base.respond_to?(:connected?) &&
::ActiveRecord::Base.connected?
::ActiveRecord::Base.establish_connection
Expand Down

0 comments on commit d5e164f

Please sign in to comment.