diff options
author | Rémy Coutable <remy@rymai.me> | 2016-04-13 12:25:42 +0300 |
---|---|---|
committer | Rémy Coutable <remy@rymai.me> | 2016-04-13 17:07:04 +0300 |
commit | 02cfbf0db5dda8ca86f4811e5d5cb055a8cc5cfb (patch) | |
tree | 2b37a9ba2144bffc8544847eb157c4dc298c2c17 /app/services | |
parent | bbf49ffca1c1be65567afa76961d176e57d40150 (diff) |
Refactor and expose only Gitlab::UrlBuilder.build(record)
Signed-off-by: Rémy Coutable <remy@rymai.me>
Diffstat (limited to 'app/services')
-rw-r--r-- | app/services/issues/base_service.rb | 2 | ||||
-rw-r--r-- | app/services/merge_requests/base_service.rb | 3 |
2 files changed, 2 insertions, 3 deletions
diff --git a/app/services/issues/base_service.rb b/app/services/issues/base_service.rb index 770f32de944..772f5c5fffa 100644 --- a/app/services/issues/base_service.rb +++ b/app/services/issues/base_service.rb @@ -3,7 +3,7 @@ module Issues def hook_data(issue, action) issue_data = issue.to_hook_data(current_user) - issue_url = Gitlab::UrlBuilder.new(:issue).build(issue.id) + issue_url = Gitlab::UrlBuilder.build(issue) issue_data[:object_attributes].merge!(url: issue_url, action: action) issue_data end diff --git a/app/services/merge_requests/base_service.rb b/app/services/merge_requests/base_service.rb index ac5b58db862..e6837a18696 100644 --- a/app/services/merge_requests/base_service.rb +++ b/app/services/merge_requests/base_service.rb @@ -20,8 +20,7 @@ module MergeRequests def hook_data(merge_request, action) hook_data = merge_request.to_hook_data(current_user) - merge_request_url = Gitlab::UrlBuilder.new(:merge_request).build(merge_request.id) - hook_data[:object_attributes][:url] = merge_request_url + hook_data[:object_attributes][:url] = Gitlab::UrlBuilder.build(merge_request) hook_data[:object_attributes][:action] = action hook_data end |