From 5b53b0d85a459fbe7970adb9b1c2022887355c8c Mon Sep 17 00:00:00 2001 From: Geremia Taglialatela Date: Wed, 8 Jan 2025 14:31:48 +0100 Subject: [PATCH] Fix circular require warning in belongs_to.rb When running specs with `RUBYOPTS='-w'`, numerous warnings are generated due to a circular require between: - `lib/active_admin/resource/belongs_to.rb` - `lib/active_admin/resource.rb` The warning message is: ``` warning: loading in progress, circular require considered harmful - ./lib/active_admin/resource.rb ``` Based on the code history, there is no specific reason for the inverse require from `belongs_to` to `resource`. This change removes the unnecessary require to eliminate the warnings. Backports #8598 to `3-0-stable` branch --- lib/active_admin/resource/belongs_to.rb | 1 - 1 file changed, 1 deletion(-) diff --git a/lib/active_admin/resource/belongs_to.rb b/lib/active_admin/resource/belongs_to.rb index 45d771c763f..b65503f6ba9 100644 --- a/lib/active_admin/resource/belongs_to.rb +++ b/lib/active_admin/resource/belongs_to.rb @@ -1,5 +1,4 @@ # frozen_string_literal: true -require "active_admin/resource" module ActiveAdmin class Resource