summaryrefslogtreecommitdiff
path: root/config
diff options
context:
space:
mode:
authorKamil Trzcinski <ayufan@ayufan.eu>2017-05-26 11:08:18 +0200
committerKamil Trzcinski <ayufan@ayufan.eu>2017-05-26 11:08:18 +0200
commit9d40646ad5e7f9a1d30fd72bda1b6abf0dbf1f37 (patch)
treee7620bf863fd6e004b5157484d4006d80fd533db /config
parent35ab669a957dd63a5c662ba909f368380e3a60c7 (diff)
downloadgitlab-ce-9d40646ad5e7f9a1d30fd72bda1b6abf0dbf1f37.tar.gz
Fix Counter Cache not being disabled for acts-on-taggablefix-counter-cache-for-acts-as-taggable
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]