Skip to content

Causes an error when you reload! with rails 8.x context[:connection] ||= connection <main>': undefined method []' for nil (NoMethodError) #219

@inspire22

Description

@inspire22
Loading development environment (Rails 8.1.2)
3.3.6 :001 > Item.first;reload!
  Item Load (0.3ms)  SELECT `items`.* FROM `items` ORDER BY `items`.`id` ASC LIMIT 1 /*application='TestRails'*/
Reloading...
 => true
3.3.6 :002 > Item.first;reload!
(test-rails):2:in `<main>': undefined method `[]' for nil (NoMethodError)

          context[:connection] ||= connection
                 ^^^^^^^^^^^^^

Through trial & error I narrowed it down to this gem.

Through more I realized it's either of these default entries in the environments/development.rb file:

config.active_record.query_log_tags_enabled = true
config.active_record.verbose_query_logs = true

That causes it to cause this problem. Any suggestions welcome!

Metadata

Metadata

Assignees

No one assigned

    Labels

    awaiting responseAwaiting response from the reporter

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions