summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRémy Coutable <remy@rymai.me>2017-02-23 22:39:48 +0000
committerRémy Coutable <remy@rymai.me>2017-02-23 22:39:48 +0000
commit2fb3fcf0c0446c9a1568e26e81d49f3b5ce159dc (patch)
tree67aa953b3e8dd0245307cdfefa9f3005659df040
parent509ff2ab170802e23646282f1d146a6383b53a66 (diff)
parent2f0599b6c851c208b5332f37509df0ada52e6d6a (diff)
downloadgitlab-ce-2fb3fcf0c0446c9a1568e26e81d49f3b5ce159dc.tar.gz
Merge branch '27989-disable-counting-tags' into 'master'
Disable unused tags count cache for Projects, Builds and Runners Closes #27989 See merge request !9467
-rw-r--r--app/models/issue.rb2
-rw-r--r--app/models/project.rb3
-rw-r--r--changelogs/unreleased/27989-disable-counting-tags.yml4
-rw-r--r--config/initializers/acts_as_taggable.rb5
4 files changed, 10 insertions, 4 deletions
diff --git a/app/models/issue.rb b/app/models/issue.rb
index d8826b65fcc..de90f19f854 100644
--- a/app/models/issue.rb
+++ b/app/models/issue.rb
@@ -15,8 +15,6 @@ class Issue < ActiveRecord::Base
DueThisWeek = DueDateStruct.new('Due This Week', 'week').freeze
DueThisMonth = DueDateStruct.new('Due This Month', 'month').freeze
- ActsAsTaggableOn.strict_case_match = true
-
belongs_to :project
belongs_to :moved_to, class_name: 'Issue'
diff --git a/app/models/project.rb b/app/models/project.rb
index 301ff71cc01..814fd0c0f4f 100644
--- a/app/models/project.rb
+++ b/app/models/project.rb
@@ -70,8 +70,7 @@ class Project < ActiveRecord::Base
after_validation :check_pending_delete
- ActsAsTaggableOn.strict_case_match = true
- acts_as_taggable_on :tags
+ acts_as_taggable
attr_accessor :new_default_branch
attr_accessor :old_path_with_namespace
diff --git a/changelogs/unreleased/27989-disable-counting-tags.yml b/changelogs/unreleased/27989-disable-counting-tags.yml
new file mode 100644
index 00000000000..988785ac454
--- /dev/null
+++ b/changelogs/unreleased/27989-disable-counting-tags.yml
@@ -0,0 +1,4 @@
+---
+title: Disable unused tags count cache for Projects, Builds and Runners
+merge_request:
+author:
diff --git a/config/initializers/acts_as_taggable.rb b/config/initializers/acts_as_taggable.rb
new file mode 100644
index 00000000000..c564c0cab11
--- /dev/null
+++ b/config/initializers/acts_as_taggable.rb
@@ -0,0 +1,5 @@
+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