summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorStan Hu <stanhu@gmail.com>2015-03-03 08:01:27 -0800
committerStan Hu <stanhu@gmail.com>2015-03-03 15:57:28 -0800
commit2088cee935e47b569f0c79b10dcb2c506b666af3 (patch)
treefbf6fc64436dcb8c72b1bd506320757f84495433 /lib
parentabc69c890513fb58c1ceae7548f4fbcc221b7c34 (diff)
downloadgitlab-ce-2088cee935e47b569f0c79b10dcb2c506b666af3.tar.gz
Fix URL builder to use GitlabRoutingHelper
Diffstat (limited to 'lib')
-rw-r--r--lib/gitlab/url_builder.rb18
1 files changed, 7 insertions, 11 deletions
diff --git a/lib/gitlab/url_builder.rb b/lib/gitlab/url_builder.rb
index 7ab3f090a89..ab7c8ad89f3 100644
--- a/lib/gitlab/url_builder.rb
+++ b/lib/gitlab/url_builder.rb
@@ -1,6 +1,7 @@
module Gitlab
class UrlBuilder
include Rails.application.routes.url_helpers
+ include GitlabRoutingHelper
def initialize(type)
@type = type
@@ -9,27 +10,22 @@ module Gitlab
def build(id)
case @type
when :issue
- issue_url(id)
+ build_issue_url(id)
when :merge_request
- merge_request_url(id)
+ build_merge_request_url(id)
end
end
private
- def issue_url(id)
+ def build_issue_url(id)
issue = Issue.find(id)
- namespace_project_issue_url(namespace_id: issue.project.namespace,
- id: issue.iid,
- project_id: issue.project,
- host: Gitlab.config.gitlab['url'])
+ issue_url(issue, host: Gitlab.config.gitlab['url'])
end
- def merge_request_url(id)
+ def build_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'])
+ merge_request_url(merge_request, host: Gitlab.config.gitlab['url'])
end
end
end