Skip to content

Commit

Permalink
Fix deprecation warning for ActiveRecord::Base.default_timezone
Browse files Browse the repository at this point in the history
  • Loading branch information
Lavika committed Oct 5, 2023
1 parent 7985ffe commit f9a2347
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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 || []
Expand Down
2 changes: 1 addition & 1 deletion lib/active_record/connection_adapters/sqlserver_adapter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit f9a2347

Please sign in to comment.