diff options
author | Stan Hu <stanhu@gmail.com> | 2017-05-26 15:15:27 +0000 |
---|---|---|
committer | Stan Hu <stanhu@gmail.com> | 2017-05-26 15:15:27 +0000 |
commit | bd259d6bab4b3c9856be6c3d2e0c16e0836c9380 (patch) | |
tree | 60210dd04871bf8195c5cf2fa064d0c9685cc55d /config/initializers | |
parent | 2eb3a40567ba63015e2cdcb2ce2fa762c367fe05 (diff) | |
parent | 9d40646ad5e7f9a1d30fd72bda1b6abf0dbf1f37 (diff) | |
download | gitlab-ce-bd259d6bab4b3c9856be6c3d2e0c16e0836c9380.tar.gz |
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/initializers')
-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] |