diff --git a/lib/active_record/connection_adapters/sqlserver/database_statements.rb b/lib/active_record/connection_adapters/sqlserver/database_statements.rb index 0a8c2f42a..9e53327b1 100644 --- a/lib/active_record/connection_adapters/sqlserver/database_statements.rb +++ b/lib/active_record/connection_adapters/sqlserver/database_statements.rb @@ -483,7 +483,7 @@ def handle_to_names_and_values_dblib(handle, options = {}) end def handle_to_names_and_values_odbc(handle, options = {}) - @connection.use_utc = ActiveRecord::Base.default_timezone == :utc + @connection.use_utc = ActiveRecord.default_timezone == :utc if options[:ar_result] columns = lowercase_schema_reflection ? handle.columns(true).map { |c| c.name.downcase } : handle.columns(true).map { |c| c.name } rows = handle.fetch_all || [] diff --git a/lib/active_record/connection_adapters/sqlserver_adapter.rb b/lib/active_record/connection_adapters/sqlserver_adapter.rb index 9caca7049..3da2ffeb9 100644 --- a/lib/active_record/connection_adapters/sqlserver_adapter.rb +++ b/lib/active_record/connection_adapters/sqlserver_adapter.rb @@ -136,7 +136,7 @@ def odbc_connect(config) end.tap do |c| begin c.use_time = true - c.use_utc = ActiveRecord::Base.default_timezone == :utc + c.use_utc = ActiveRecord.default_timezone == :utc rescue Exception warn 'Ruby ODBC v0.99992 or higher is required.' end