Skip to content

Quash require_dependency warnings with newer Rails#54

Merged
flavorjones merged 1 commit into
masterfrom
remote-require-dependency
May 21, 2026
Merged

Quash require_dependency warnings with newer Rails#54
flavorjones merged 1 commit into
masterfrom
remote-require-dependency

Conversation

@flavorjones
Copy link
Copy Markdown
Member

Rails warnings look like:

DEPRECATION WARNING: require_dependency is deprecated without replacement and will be removed
in Rails 9.

- Recommendations for applications:

    - If the call is an old one written in the days of the classic autoloader to ensure a
      certain constant is loaded for constant lookup to work as expected, you can simply
      remove it.

    - In order to preload classes when the application boots, which may be necessary for
      things like STIs or Kafka consumers, please check the autoloading guide for modern
      approaches.

- Recommendations for engines that depend on Rails >= 7.0:

  Same recommendations as for applications, since the classic autoloader is no longer
  available starting with Rails 7.0.

- Recommendations for engines that support Rails < 7.0:

  Guard the call with a version check just in case the parent application is using
  the classic autoloader:

      require_dependency "some_file" if Rails::VERSION::MAJOR < 7

Copilot AI review requested due to automatic review settings May 21, 2026 13:35
@flavorjones flavorjones merged commit b2d381a into master May 21, 2026
4 of 5 checks passed
@flavorjones flavorjones deleted the remote-require-dependency branch May 21, 2026 13:36
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Updates Easymon’s controller loading logic to avoid require_dependency deprecation warnings on newer Rails versions, while preserving compatibility with older Rails classic-autoloader setups.

Changes:

  • Guard require_dependency "easymon/application_controller" behind a Rails::VERSION::MAJOR < 7 check to prevent deprecation warnings on Rails 7+.

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.

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