Skip to content

ActiveRecord issue after upgrading to 2.18.0 #1923

@flying-robot

Description

@flying-robot

Afternoon! We've been running RES in a Rails 8.1.1 application for a while with no issues. After the most recent upgrade from 2.17.1 to 2.18.0, we hit the following issue in one of our initializers:

config/initializers/postgresql_adapter.rb:3:in '<main>': uninitialized constant ActiveRecord::ConnectionAdapters::PostgreSQLAdapter (NameError)

ActiveRecord::ConnectionAdapters::PostgreSQLAdapter.datetime_type = :timestamptz
                                ^^^^^^^^^^^^^^^^^^^

The culprit seems to be this change: dd520. If we reset the code in active_record.rb to c54cb, then the application boots successfully. I worked around this within our initializer by making things more deterministic, but just wanted to surface the issue for y'all:

# frozen_string_literal: true

ActiveSupport.on_load(:active_record) do
  require "active_record/connection_adapters/postgresql_adapter"

  ActiveRecord::ConnectionAdapters::PostgreSQLAdapter.datetime_type = :timestamptz
end

Thanks in advance!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions