diff options
author | Sean McGivern <sean@mcgivern.me.uk> | 2017-03-21 15:25:00 +0000 |
---|---|---|
committer | Sean McGivern <sean@mcgivern.me.uk> | 2017-03-21 15:25:00 +0000 |
commit | 1974691bfe372f805a635319a8f7dbd6e0537485 (patch) | |
tree | bd4bf0c17f74e6b12c1859f0b87dc76a545c7222 /app/models | |
parent | db8f52d4014b489eb11c8408db262a9329c8800d (diff) | |
download | gitlab-ce-1974691bfe372f805a635319a8f7dbd6e0537485.tar.gz |
Revert "Merge branch '29534-todos-performance' into 'master'"
This reverts merge request !10076
Diffstat (limited to 'app/models')
-rw-r--r-- | app/models/merge_request.rb | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/app/models/merge_request.rb b/app/models/merge_request.rb index cef8ad76b07..4759829a15c 100644 --- a/app/models/merge_request.rb +++ b/app/models/merge_request.rb @@ -7,7 +7,6 @@ class MergeRequest < ActiveRecord::Base belongs_to :target_project, class_name: "Project" belongs_to :source_project, class_name: "Project" - belongs_to :project, foreign_key: :target_project_id belongs_to :merge_user, class_name: "User" has_many :merge_request_diffs, dependent: :destroy @@ -541,6 +540,10 @@ class MergeRequest < ActiveRecord::Base target_project != source_project end + def project + target_project + end + # If the merge request closes any issues, save this information in the # `MergeRequestsClosingIssues` model. This is a performance optimization. # Calculating this information for a number of merge requests requires |