Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJames Edwards-Jones <jedwardsjones@gitlab.com>2016-12-16 18:52:27 +0300
committerJames Edwards-Jones <jedwardsjones@gitlab.com>2016-12-20 15:45:29 +0300
commit27c936adf9728cd21114aa3f2f9b44deb0296eb4 (patch)
treeeee3a69f32c44c3f74d113ef03867b4387d22ba3 /app/models/milestone.rb
parent01adeb17acccab09eb0074725050356d9d431c8a (diff)
Milestoneish SQL performance partially improved and memoized
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