File tree Expand file tree Collapse file tree 1 file changed +16
-6
lines changed
lib/active_record/connection_adapters Expand file tree Collapse file tree 1 file changed +16
-6
lines changed Original file line number Diff line number Diff line change @@ -118,13 +118,8 @@ def config_encoding(config)
118
118
119
119
def initialize ( connection , logger , _connection_options , config )
120
120
super ( connection , logger , config )
121
-
122
121
@connection_options = config
123
- @spid = _raw_select ( "SELECT @@SPID" , fetch : :rows ) . first . first
124
- @version_year = version_year
125
-
126
- initialize_dateformatter
127
- use_database
122
+ configure_connection
128
123
end
129
124
130
125
# === Abstract Adapter ========================================== #
@@ -285,6 +280,14 @@ def reset!
285
280
do_execute "IF @@TRANCOUNT > 0 ROLLBACK TRANSACTION"
286
281
end
287
282
283
+ def configure_connection
284
+ @spid = _raw_select ( "SELECT @@SPID" , fetch : :rows ) . first . first
285
+ @version_year = version_year
286
+
287
+ initialize_dateformatter
288
+ use_database
289
+ end
290
+
288
291
# === Abstract Adapter (Misc Support) =========================== #
289
292
290
293
def tables_with_referential_integrity
@@ -501,6 +504,13 @@ def version_year
501
504
def sqlserver_version
502
505
@sqlserver_version ||= _raw_select ( "SELECT @@version" , fetch : :rows ) . first . first . to_s
503
506
end
507
+
508
+ private
509
+
510
+ def connect
511
+ @connection = self . class . new_client ( @connection_options )
512
+ configure_connection
513
+ end
504
514
end
505
515
end
506
516
end
You can’t perform that action at this time.
0 commit comments