diff options
author | Hiroyuki Sato <sathiroyuki@gmail.com> | 2018-01-12 23:38:36 +0300 |
---|---|---|
committer | Clement Ho <clemmakesapps@gmail.com> | 2018-01-12 23:38:36 +0300 |
commit | a7d26f00c35b945199d40332349f463043ae6122 (patch) | |
tree | 7b76a2e305e4a4f81f61271337c9731d0d50e16f /app/models/commit.rb | |
parent | 1b5f179557d03683f92ed3af3d357df056cc8ece (diff) |
Display related merge requests in commit detail page
Diffstat (limited to 'app/models/commit.rb')
-rw-r--r-- | app/models/commit.rb | 4 |
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 |