From cfee860748ce3e3060a14b6ab5e58cd3e038c5c5 Mon Sep 17 00:00:00 2001 From: Kevin McCormack Date: Mon, 4 May 2020 15:57:43 -0400 Subject: [PATCH] Update jdbc_overrides.rb Was getting the following with Rails 5.0 and 5.1 ``` NoMethodError (undefined method `setSendTimeAsDatetime' for #) Did you mean? sendTimeAsDatetime ``` This guard clause fixed it for me. --- .../connection_adapters/sqlserver/jdbc_overrides.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/active_record/connection_adapters/sqlserver/jdbc_overrides.rb b/lib/active_record/connection_adapters/sqlserver/jdbc_overrides.rb index 8ce9b9558..4444dc724 100644 --- a/lib/active_record/connection_adapters/sqlserver/jdbc_overrides.rb +++ b/lib/active_record/connection_adapters/sqlserver/jdbc_overrides.rb @@ -99,6 +99,7 @@ def supports_transaction_isolation? # Called to set any connection specific settings that aren't defined ahead of time def configure_connection + return unless @connection.connection.respond_to? :setSendTimeAsDatetime # For sql server 2008+ we want it to send an actual time otherwise comparisons with time columns don't work @connection.connection.setSendTimeAsDatetime(false) end