Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Close ActiveRecord connections at end of prefork #9

Merged
merged 1 commit into from

7 participants

Sarah Mei Grant Hutchins VR Engineering Pair Aaron Graves Matthew Lehner Rein Henrichs Tim Harper
Sarah Mei

Fixes this issue in sporkrb (which should have been filed here :):
sporkrb/spork#188

In rspec, rake runs rake db:test:prepare, which drops
the test database, and if you don't close the connection
spork prevents the database from being dropped.

Matthew Kocher & Sarah Mei Close ActiveRecord connections at end of prefork
In rspec, rake runs rake db:test:prepare, which drops
the test database, and if you don't close the connection
spork prevents the database from being dropped.
cc27599
Grant Hutchins

+1

VR Engineering Pair

+1

Aaron Graves

+1

Would love to get this merged, I run into this issue constantly...

Matthew Lehner

+1 - this would change my life.

Rein Henrichs

:+1: @timcharper let's get this in please!

Tim Harper timcharper merged commit d9084f9 into from
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Jun 14, 2012
  1. Close ActiveRecord connections at end of prefork

    Matthew Kocher & Sarah Mei authored
    In rspec, rake runs rake db:test:prepare, which drops
    the test database, and if you don't close the connection
    spork prevents the database from being dropped.
This page is out of date. Refresh to see the latest.
Showing with 1 addition and 0 deletions.
  1. +1 −0  lib/spork/app_framework/rails.rb
1  lib/spork/app_framework/rails.rb
View
@@ -6,6 +6,7 @@ def preload(&block)
ENV["RAILS_ENV"] ||= 'test'
preload_rails
yield
+ ActiveRecord::Base.remove_connection if defined?(ActiveRecord)
end
def entry_point
Something went wrong with that request. Please try again.