Skip to content

Commit f7f32b9

Browse files
committed
Cleanup after ConnectionPoolTest; also inject a :defer option for calculations
1 parent fa9f549 commit f7f32b9

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

lib/active_record/connection_adapters/mysqlplus_adapter/deferrable/macro.rb

+1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ class << self
77
def install!
88
ActiveRecord::Base.send :extend, SingletonMethods
99
ar_eigenclass::VALID_FIND_OPTIONS << :defer
10+
ActiveRecord::Calculations::CALCULATIONS_OPTIONS << :defer
1011
alias_deferred :find, :find_by_sql, :preload_associations, :find_every
1112
end
1213

test/connection_pool_test.rb

+6
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,12 @@
44

55
class ConnectionPoolTest < ActiveSupport::TestCase
66

7+
def teardown
8+
ActiveRecord::Base.clear_all_connections!
9+
ActiveRecord::Base.establish_connection( Mysqlplus::Test::CONNECTION_SPEC )
10+
super
11+
end
12+
713
test "should not establish connections in a lazy manner when warmed up" do
814
ActiveRecord::Base.connection_pool.expects(:checkout_new_connection).never
915
5.times do

0 commit comments

Comments
 (0)