Background
As part of the Rails 8 upgrade (#1015), advancing config.load_defaults to 7.2 adopts the Rails 7.2 default:
active_record.postgresql_adapter_decode_dates = true
This causes date-typed columns returned via raw SQL (connection.exec_query, select_value, etc.) to be decoded as Ruby Date objects instead of String. Previously such values came back as strings.
Why this is temporarily overridden
Test coverage for raw-SQL date decoding is incomplete. There are direct raw-SQL paths that bypass the ActiveRecord type layer, e.g.:
app/models/admin/migration_generator.rb (connection.exec_query)
app/models/full_text_search/tsvector_writer.rb (conn.exec_query)
app/models/nfs_store/manage/archived_file.rb (connection.exec_query)
In addition, report and dynamic-model SQL is configuration-driven, so the test suite cannot see all consumers of raw date values. To keep behaviour attributable during the Rails 8 upgrade, we have explicitly pinned the old behaviour:
# config/application.rb
config.active_record.postgresql_adapter_decode_dates = false
Goal
Remove the override and adopt the Rails 7.2 default (= true) once we have verified all raw-SQL date consumers behave correctly with Date objects.
Acceptance criteria
Refs #1015
Background
As part of the Rails 8 upgrade (#1015), advancing
config.load_defaultsto7.2adopts the Rails 7.2 default:active_record.postgresql_adapter_decode_dates = trueThis causes
date-typed columns returned via raw SQL (connection.exec_query,select_value, etc.) to be decoded as RubyDateobjects instead ofString. Previously such values came back as strings.Why this is temporarily overridden
Test coverage for raw-SQL date decoding is incomplete. There are direct raw-SQL paths that bypass the ActiveRecord type layer, e.g.:
app/models/admin/migration_generator.rb(connection.exec_query)app/models/full_text_search/tsvector_writer.rb(conn.exec_query)app/models/nfs_store/manage/archived_file.rb(connection.exec_query)In addition, report and dynamic-model SQL is configuration-driven, so the test suite cannot see all consumers of raw date values. To keep behaviour attributable during the Rails 8 upgrade, we have explicitly pinned the old behaviour:
Goal
Remove the override and adopt the Rails 7.2 default (
= true) once we have verified all raw-SQL date consumers behave correctly withDateobjects.Acceptance criteria
exec_query,select_value,select_all,select_rows,find_by_sql) that can return adate-typed column.postgresql_adapter_decode_dates = falseoverride fromconfig/application.rb.Refs #1015