Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/config
diff options
context:
space:
mode:
authorStan Hu <stanhu@gmail.com>2017-05-26 18:15:27 +0300
committerStan Hu <stanhu@gmail.com>2017-05-26 18:15:27 +0300
commitbd259d6bab4b3c9856be6c3d2e0c16e0836c9380 (patch)
tree60210dd04871bf8195c5cf2fa064d0c9685cc55d /config
parent2eb3a40567ba63015e2cdcb2ce2fa762c367fe05 (diff)
parent9d40646ad5e7f9a1d30fd72bda1b6abf0dbf1f37 (diff)
Merge branch 'fix-counter-cache-for-acts-as-taggable' into 'master'
Fix Counter Cache not being disabled for acts-on-taggable Closes #30582 See merge request !11727
Diffstat (limited to 'config')
-rw-r--r--config/initializers/0_acts_as_taggable.rb (renamed from config/initializers/acts_as_taggable.rb)4
1 files changed, 4 insertions, 0 deletions
diff --git a/config/initializers/acts_as_taggable.rb b/config/initializers/0_acts_as_taggable.rb
index c564c0cab11..54e9fcc31db 100644
--- a/config/initializers/acts_as_taggable.rb
+++ b/config/initializers/0_acts_as_taggable.rb
@@ -3,3 +3,7 @@ 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
+
+# validate that counter cache is disabled
+raise "Counter cache is not disabled" if
+ ActsAsTaggableOn::Tagging.reflections["tag"].options[:counter_cache]