From 3ac9bb5e7ee5f272c9237a5522f294322e6d9382 Mon Sep 17 00:00:00 2001 From: Sergio Cambra Date: Wed, 8 Jan 2025 20:11:37 +0100 Subject: [PATCH] fix deprecation messages in rails 7.1 --- lib/active_scaffold.rb | 6 +++++- lib/active_scaffold/data_structures/action_links.rb | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/lib/active_scaffold.rb b/lib/active_scaffold.rb index 3ccd4c851..7ee32f1b2 100644 --- a/lib/active_scaffold.rb +++ b/lib/active_scaffold.rb @@ -68,7 +68,7 @@ def self.js_framework=(framework) end when :prototype then warning += ', convert your app to jQuery, and remove this call' end - ActiveSupport::Deprecation.warn warning + deprecator.warn warning @@js_framework = framework end @@ -110,6 +110,10 @@ def self.root def self.defaults(&block) ActiveScaffold::Config::Core.configure(&block) end + + def self.deprecator + @deprecator ||= ActiveSupport::Deprecation.new('4.0', 'ActiveScaffold') + end end require 'active_scaffold/engine' require 'ice_nine' diff --git a/lib/active_scaffold/data_structures/action_links.rb b/lib/active_scaffold/data_structures/action_links.rb index 0bbd74fd2..62016224d 100644 --- a/lib/active_scaffold/data_structures/action_links.rb +++ b/lib/active_scaffold/data_structures/action_links.rb @@ -177,9 +177,9 @@ def respond_to_missing?(name, *) attr_accessor :css_class def name=(value) - ActiveSupport::Deprecation.warn 'Changing name is deprecated, use css_class to change the class html attribute' self.css_class = value end + ActiveScaffold.deprecator.deprecate_methods(self, :name= => :css_class=) protected