diff options
author | Adam Niedzielski <adamsunday@gmail.com> | 2017-01-06 13:47:18 +0100 |
---|---|---|
committer | Adam Niedzielski <adamsunday@gmail.com> | 2017-01-06 13:47:18 +0100 |
commit | f13c650c161b07bf8d6ad5db849fe9f442f6d0ac (patch) | |
tree | f8517deb61d8e485f8fbe1b6d87142f4c5b43567 /app/models/group_milestone.rb | |
parent | aec04a47c16665f1dfb1fb61647c3f78a4dde20f (diff) | |
download | gitlab-ce-f13c650c161b07bf8d6ad5db849fe9f442f6d0ac.tar.gz |
Speed up group milestone index by passing group_id to IssuesFinder
Diffstat (limited to 'app/models/group_milestone.rb')
-rw-r--r-- | app/models/group_milestone.rb | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/app/models/group_milestone.rb b/app/models/group_milestone.rb new file mode 100644 index 00000000000..7b6db2634b7 --- /dev/null +++ b/app/models/group_milestone.rb @@ -0,0 +1,19 @@ +class GroupMilestone < GlobalMilestone + attr_accessor :group + + def self.build_collection(group, projects, params) + super(projects, params).each do |milestone| + milestone.group = group + end + end + + def self.build(group, projects, title) + super(projects, title).tap do |milestone| + milestone.group = group if milestone + end + end + + def issues_finder_params + { group_id: group.id } + end +end |