diff options
author | Rémy Coutable <remy@rymai.me> | 2016-04-14 13:27:49 +0300 |
---|---|---|
committer | Rémy Coutable <remy@rymai.me> | 2016-04-14 13:27:49 +0300 |
commit | c71cdb194f6b30997826929190eaee70f762848a (patch) | |
tree | dd2106634c34119887dec2e0f509acefa0f32407 /app/services | |
parent | 595aba54afce01a7903990f6630ae03de1c4d61e (diff) | |
parent | 02cfbf0db5dda8ca86f4811e5d5cb055a8cc5cfb (diff) |
Merge branch 'simplify-gitlab-url_builder-15202' into 'master'
Refactor and expose only Gitlab::UrlBuilder.build(record)
```
$ git grep Gitlab::UrlBuilder
app/models/commit.rb: url: Gitlab::UrlBuilder.build(self),
app/services/issues/base_service.rb: issue_url = Gitlab::UrlBuilder.build(issue)
app/services/merge_requests/base_service.rb: hook_data[:object_attributes][:url] = Gitlab::UrlBuilder.build(merge_request)
app/views/search/results/_note.html.haml:- note_url = Gitlab::UrlBuilder.build(note)
lib/gitlab/note_data_builder.rb: base_data[:object_attributes][:url] = Gitlab::UrlBuilder.build(note)
spec/lib/gitlab/note_data_builder_spec.rb: expect(data[:object_attributes][:url]).to eq(Gitlab::UrlBuilder.build(note))
spec/lib/gitlab/url_builder_spec.rb:describe Gitlab::UrlBuilder, lib: true do
```
Fixes #15202.
See merge request !3696
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 |