Skip to content

Fix compatibility with rails 9#75

Open
chaadow wants to merge 3 commits into
basecamp:masterfrom
chaadow:master
Open

Fix compatibility with rails 9#75
chaadow wants to merge 3 commits into
basecamp:masterfrom
chaadow:master

Conversation

@chaadow

@chaadow chaadow commented Mar 22, 2026

Copy link
Copy Markdown

require_dependency will be removed in rails 9

Copilot AI review requested due to automatic review settings March 22, 2026 22:14

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the engine controllers to be compatible with Rails 9 by removing require_dependency calls that are slated for removal, relying on Rails/ Zeitwerk autoloading instead.

Changes:

  • Removed require_dependency "audits1984/application_controller" from engine controllers.
  • Kept controller inheritance and module structure unchanged to preserve existing behavior.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
app/controllers/audits1984/sessions_controller.rb Removes require_dependency for Rails 9 compatibility.
app/controllers/audits1984/filtered_sessions_controller.rb Removes require_dependency for Rails 9 compatibility.
app/controllers/audits1984/audits_controller.rb Removes require_dependency for Rails 9 compatibility.

Tip

If you aren't ready for review, convert to a draft PR.
Click "Convert to draft" or run gh pr ready --undo.
Click "Ready for review" or run gh pr ready to reengage.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copilot AI review requested due to automatic review settings April 2, 2026 01:33

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread lib/audits1984/engine.rb
foreign_key: :auditor_id,
dependent: :delete
initializer "audits1984.auditor_token_association" do
Rails.autoloaders.main.on_load(Audits1984.auditor_class) do |klass, _abspath|

Copilot AI Apr 2, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Rails.autoloaders.main.on_load method expects a class constant, not a string. Since Audits1984.auditor_class is a string (e.g., "::User"), this will fail at runtime. The string needs to be converted to a constant using .constantize before being passed to on_load.

Suggested change
Rails.autoloaders.main.on_load(Audits1984.auditor_class) do |klass, _abspath|
Rails.autoloaders.main.on_load(Audits1984.auditor_class.constantize) do |klass, _abspath|

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants