Skip to content

Commit f549de5

Browse files
committed
Caching the #database_version for a bit of performance. I doubt this will dynamically change and/or someone will be using connection pools with different DB versions.
1 parent 57c7d0d commit f549de5

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/active_record/connection_adapters/sqlserver_adapter.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -307,7 +307,7 @@ def supports_ddl_transactions?
307307
end
308308

309309
def database_version
310-
select_value "SELECT @@version"
310+
@database_version ||= select_value('SELECT @@version')
311311
end
312312

313313
def database_year

0 commit comments

Comments
 (0)