From 3c171a61b109728aa65dc3904980a3f2e0cd54dc Mon Sep 17 00:00:00 2001 From: Jean Boussier Date: Sun, 6 Oct 2024 10:27:06 -0400 Subject: [PATCH] Fix compatibility with Rails 7.1 and older Fix: https://github.com/rails/activeresource/issues/406 --- lib/active_resource/railtie.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/active_resource/railtie.rb b/lib/active_resource/railtie.rb index 0a0492de58..dc4e08d6af 100644 --- a/lib/active_resource/railtie.rb +++ b/lib/active_resource/railtie.rb @@ -23,7 +23,9 @@ class Railtie < Rails::Railtie end initializer "active_resource.deprecator" do |app| - app.deprecators[:active_resource] = ActiveResource.deprecator + if app.respond_to?(:deprecators) + app.deprecators[:active_resource] = ActiveResource.deprecator + end end end end