diff options
author | Stan Hu <stanhu@gmail.com> | 2015-02-24 09:50:40 +0300 |
---|---|---|
committer | Stan Hu <stanhu@gmail.com> | 2015-02-24 09:51:24 +0300 |
commit | e363f2e67544e210e92acc06a5af90d91c0aa684 (patch) | |
tree | a3fb6c8576c24a3f6dd79ccb9a9c9f4e69615f67 /lib | |
parent | 24c8381de281576deeaacf6ba1b46271767594d8 (diff) |
Fix merge request URL passed to Webhooks.
Previously the symbol "url" in the object_attributes hash would always be nil.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/gitlab/url_builder.rb | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/gitlab/url_builder.rb b/lib/gitlab/url_builder.rb index e7153cc3225..7ab3f090a89 100644 --- a/lib/gitlab/url_builder.rb +++ b/lib/gitlab/url_builder.rb @@ -10,6 +10,8 @@ module Gitlab case @type when :issue issue_url(id) + when :merge_request + merge_request_url(id) end end @@ -22,5 +24,12 @@ module Gitlab project_id: issue.project, host: Gitlab.config.gitlab['url']) end + + def merge_request_url(id) + merge_request = MergeRequest.find(id) + project_merge_request_url(id: merge_request.id, + project_id: merge_request.project, + host: Gitlab.config.gitlab['url']) + end end end |