diff options
author | Kamil Trzcinski <ayufan@ayufan.eu> | 2017-05-26 12:08:18 +0300 |
---|---|---|
committer | Kamil Trzcinski <ayufan@ayufan.eu> | 2017-05-26 12:08:18 +0300 |
commit | 9d40646ad5e7f9a1d30fd72bda1b6abf0dbf1f37 (patch) | |
tree | e7620bf863fd6e004b5157484d4006d80fd533db /config/initializers/0_acts_as_taggable.rb | |
parent | 35ab669a957dd63a5c662ba909f368380e3a60c7 (diff) |
Fix Counter Cache not being disabled for acts-on-taggable
Diffstat (limited to 'config/initializers/0_acts_as_taggable.rb')
-rw-r--r-- | config/initializers/0_acts_as_taggable.rb | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/config/initializers/0_acts_as_taggable.rb b/config/initializers/0_acts_as_taggable.rb new file mode 100644 index 00000000000..54e9fcc31db --- /dev/null +++ b/config/initializers/0_acts_as_taggable.rb @@ -0,0 +1,9 @@ +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] |