From 65e14fd23f281429fb807267953dc070ce7c0f4e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javi=20Mart=C3=ADn?= Date: Tue, 19 Mar 2024 21:16:06 +0100 Subject: [PATCH] Add initializer included in acts-as-taggable-on 10.0.0 Similar to what we do with other gems, we add the commented code. --- config/initializers/acts_as_taggable_on.rb | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/config/initializers/acts_as_taggable_on.rb b/config/initializers/acts_as_taggable_on.rb index d661338bb..7dea4aafc 100644 --- a/config/initializers/acts_as_taggable_on.rb +++ b/config/initializers/acts_as_taggable_on.rb @@ -1,3 +1,12 @@ +ActsAsTaggableOn.setup do |config| + # This works because the classes where the base class is a concern, Tag and Tagging + # are autoloaded, and won't be started until after the initializers run. The value + # must be a String, as the Rails Zeitwerk autoloader will not allow models to be + # referenced at initialization time. + # + # config.base_class = "ApplicationRecord" +end + module ActsAsTaggableOn Tagging.class_eval do after_create :increment_tag_custom_counter