Commit b43d3af7 authored by Timothy Andrew's avatar Timothy Andrew

Miscellaneous cycle-analytics-related changes.

1. Add indexes to `CreateMergeRequestsClosingIssues` columns.
2. Remove an extraneous `check_if_open` check that is redundant now.

It would've been better to rebase this in, but that's not possible
because more people are working on this branch.
parent d0e101e9
......@@ -210,11 +210,7 @@ class Issue < ActiveRecord::Base
note.all_references(current_user, extractor: ext)
end
if check_if_open
ext.merge_requests.select { |mr| mr.open? && mr.closes_issue?(self) }
else
ext.merge_requests.select { |mr| mr.closes_issue?(self) }
end
ext.merge_requests.select { |mr| mr.open? && mr.closes_issue?(self) }
end
def moved?
......
......@@ -25,8 +25,8 @@ class CreateMergeRequestsClosingIssues < ActiveRecord::Migration
def change
create_table :merge_requests_closing_issues do |t|
t.references :merge_request, foreign_key: true, null: false
t.references :issue, foreign_key: true, null: false
t.references :merge_request, foreign_key: true, index: true, null: false
t.references :issue, foreign_key: true, index: true, null: false
t.timestamps null: false
end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment