Skip to content

Commit 946bc94

Browse files
committed
Connect to the DB at the bottom of AR::TestCase class definition
1 parent 4ba87aa commit 946bc94

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

activerecord/test/cases/helper.rb

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,6 @@
1111
require "active_support/core_ext/kernel/reporting"
1212
require "active_support/core_ext/kernel/singleton_class"
1313

14-
require "support/config"
15-
require "support/connection"
16-
1714
# TODO: Move all these random hacks into the ARTest namespace and into the support/ dir
1815

1916
Thread.abort_on_exception = true
@@ -24,9 +21,6 @@
2421
# Disable available locale checks to avoid warnings running the test suite.
2522
I18n.enforce_available_locales = false
2623

27-
# Connect to the database
28-
ARTest.connect
29-
3024
# Quote "type" if it's a reserved word for the current connection.
3125
QUOTED_TYPE = ActiveRecord::Base.connection.quote_column_name("type")
3226

activerecord/test/cases/test_case.rb

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88
require "active_record/fixtures"
99

1010
require "cases/validations_repair_helper"
11+
require_relative "../support/config"
12+
require_relative "../support/connection"
1113
require_relative "../support/adapter_helper"
1214

1315
module ActiveRecord
@@ -220,6 +222,9 @@ def clean_up_connection_handler
220222
end
221223
end
222224
end
225+
226+
# Connect to the database
227+
ARTest.connect
223228
end
224229

225230
class PostgreSQLTestCase < TestCase

0 commit comments

Comments
 (0)