Skip to content

Honor database-config-specific default_timezone configuration value #1329

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -210,7 +210,7 @@ def execute_procedure(proc_name, *variables)
with_raw_connection do |conn|
result = internal_raw_execute(sql, conn)
verified!
options = { as: :hash, cache_rows: true, timezone: ActiveRecord.default_timezone || :utc }
options = { as: :hash, cache_rows: true, timezone: @config[:default_timezone]&.to_sym || ActiveRecord.default_timezone || :utc }

result.each(options) do |row|
r = row.with_indifferent_access
@@ -473,7 +473,7 @@ def _raw_select(sql, conn)

def handle_to_names_and_values(handle, options = {})
query_options = {}.tap do |qo|
qo[:timezone] = ActiveRecord.default_timezone || :utc
qo[:timezone] = @config[:default_timezone]&.to_sym || ActiveRecord.default_timezone || :utc
qo[:as] = (options[:ar_result] || options[:fetch] == :rows) ? :array : :hash
end
results = handle.each(query_options)