summaryrefslogtreecommitdiff
path: root/app/models/milestone.rb
diff options
context:
space:
mode:
authorJames Edwards-Jones <jedwardsjones@gitlab.com>2016-12-16 15:52:27 +0000
committerJames Edwards-Jones <jedwardsjones@gitlab.com>2016-12-20 12:45:29 +0000
commit27c936adf9728cd21114aa3f2f9b44deb0296eb4 (patch)
treeeee3a69f32c44c3f74d113ef03867b4387d22ba3 /app/models/milestone.rb
parent01adeb17acccab09eb0074725050356d9d431c8a (diff)
downloadgitlab-ce-27c936adf9728cd21114aa3f2f9b44deb0296eb4.tar.gz
Milestoneish SQL performance partially improved and memoizedjej-memoize-milestoneish-visible-to-user
Memoize Milestoneish#issues_visible_to_user and counts to reduce lookups Milstoneish SQL optimised with project, but still slow on GlobalMilestone
Diffstat (limited to 'app/models/milestone.rb')
-rw-r--r--app/models/milestone.rb4
1 files changed, 4 insertions, 0 deletions
diff --git a/app/models/milestone.rb b/app/models/milestone.rb
index 45ca97adad1..0dcfec89f14 100644
--- a/app/models/milestone.rb
+++ b/app/models/milestone.rb
@@ -129,6 +129,10 @@ class Milestone < ActiveRecord::Base
self.title
end
+ def milestoneish_ids
+ id
+ end
+
def can_be_closed?
active? && issues.opened.count.zero?
end