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 ...@@ -210,11 +210,7 @@ class Issue < ActiveRecord::Base
note.all_references(current_user, extractor: ext) note.all_references(current_user, extractor: ext)
end end
if check_if_open ext.merge_requests.select { |mr| mr.open? && mr.closes_issue?(self) }
ext.merge_requests.select { |mr| mr.open? && mr.closes_issue?(self) }
else
ext.merge_requests.select { |mr| mr.closes_issue?(self) }
end
end end
def moved? def moved?
......
...@@ -25,8 +25,8 @@ class CreateMergeRequestsClosingIssues < ActiveRecord::Migration ...@@ -25,8 +25,8 @@ class CreateMergeRequestsClosingIssues < ActiveRecord::Migration
def change def change
create_table :merge_requests_closing_issues do |t| create_table :merge_requests_closing_issues do |t|
t.references :merge_request, foreign_key: true, null: false t.references :merge_request, foreign_key: true, index: true, null: false
t.references :issue, foreign_key: true, null: false t.references :issue, foreign_key: true, index: true, null: false
t.timestamps null: false t.timestamps null: false
end 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