summaryrefslogtreecommitdiff
path: root/app/models/commit.rb
diff options
context:
space:
mode:
authorHiroyuki Sato <sathiroyuki@gmail.com>2018-01-12 20:38:36 +0000
committerClement Ho <clemmakesapps@gmail.com>2018-01-12 20:38:36 +0000
commita7d26f00c35b945199d40332349f463043ae6122 (patch)
tree7b76a2e305e4a4f81f61271337c9731d0d50e16f /app/models/commit.rb
parent1b5f179557d03683f92ed3af3d357df056cc8ece (diff)
downloadgitlab-ce-a7d26f00c35b945199d40332349f463043ae6122.tar.gz
Display related merge requests in commit detail page
Diffstat (limited to 'app/models/commit.rb')
-rw-r--r--app/models/commit.rb4
1 files changed, 4 insertions, 0 deletions
diff --git a/app/models/commit.rb b/app/models/commit.rb
index ede8ad301e4..21904c87f01 100644
--- a/app/models/commit.rb
+++ b/app/models/commit.rb
@@ -238,6 +238,10 @@ class Commit
notes.includes(:author)
end
+ def merge_requests
+ @merge_requests ||= project.merge_requests.by_commit_sha(sha)
+ end
+
def method_missing(method, *args, &block)
@raw.__send__(method, *args, &block) # rubocop:disable GitlabSecurity/PublicSend
end