Permalink
Browse files

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.
  • Loading branch information...
1 parent 1b0ba31 commit cc27599065d82ed30dfe21f0a793917ff921cd01 Matthew Kocher & Sarah Mei committed Jun 14, 2012
Showing with 1 addition and 0 deletions.
  1. +1 −0 lib/spork/app_framework/rails.rb
View
1 lib/spork/app_framework/rails.rb
@@ -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

0 comments on commit cc27599

Please sign in to comment.