2021-02-03 21:09:17 +00:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2017-02-23 11:36:23 +00:00
|
|
|
ActsAsTaggableOn.strict_case_match = true
|
|
|
|
|
|
|
|
# tags_counter enables caching count of tags which results in an update whenever a tag is added or removed
|
|
|
|
# since the count is not used anywhere its better performance wise to disable this cache
|
|
|
|
ActsAsTaggableOn.tags_counter = false
|
2017-05-26 09:08:18 +00:00
|
|
|
|
|
|
|
# validate that counter cache is disabled
|
2017-08-15 17:44:37 +00:00
|
|
|
raise "Counter cache is not disabled" if
|
2017-05-26 09:08:18 +00:00
|
|
|
ActsAsTaggableOn::Tagging.reflections["tag"].options[:counter_cache]
|
2021-11-08 12:12:07 +00:00
|
|
|
|
|
|
|
# Redirects retrieve_connection to use Ci::ApplicationRecord's connection
|
|
|
|
[::ActsAsTaggableOn::Tag, ::ActsAsTaggableOn::Tagging].each do |model|
|
|
|
|
model.connection_specification_name = Ci::ApplicationRecord.connection_specification_name
|
|
|
|
model.singleton_class.delegate :connection, :sticking, to: '::Ci::ApplicationRecord'
|
|
|
|
end
|