Skip to content

Commit 6863f82

Browse files
committed
Remove deprecation warning
DEPRECATION WARNING: ActiveRecord::Base.default_timezone is deprecated and will be removed in Rails 7.1. Use `ActiveRecord.default_timezone` instead.
1 parent 65b29cc commit 6863f82

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/active_record/connection_adapters/sqlserver/database_statements.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ def execute_procedure(proc_name, *variables)
168168
case @connection_options[:mode]
169169
when :dblib
170170
result = ensure_established_connection! { dblib_execute(sql) }
171-
options = { as: :hash, cache_rows: true, timezone: ActiveRecord::Base.default_timezone || :utc }
171+
options = { as: :hash, cache_rows: true, timezone: ActiveRecord.default_timezone || :utc }
172172
result.each(options) do |row|
173173
r = row.with_indifferent_access
174174
yield(r) if block_given?
@@ -441,7 +441,7 @@ def handle_to_names_and_values(handle, options = {})
441441

442442
def handle_to_names_and_values_dblib(handle, options = {})
443443
query_options = {}.tap do |qo|
444-
qo[:timezone] = ActiveRecord::Base.default_timezone || :utc
444+
qo[:timezone] = ActiveRecord.default_timezone || :utc
445445
qo[:as] = (options[:ar_result] || options[:fetch] == :rows) ? :array : :hash
446446
end
447447
results = handle.each(query_options)

0 commit comments

Comments
 (0)