From 87760a290eddbc35f4e89b129da6ec842a70f609 Mon Sep 17 00:00:00 2001 From: Jeroen van Baarsen Date: Fri, 13 Jun 2014 12:34:15 +0200 Subject: Added an UrlBuilder for building rails named routes Signed-off-by: Jeroen van Baarsen --- app/services/issues/base_service.rb | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'app') diff --git a/app/services/issues/base_service.rb b/app/services/issues/base_service.rb index 41fbe1ae08f..71b9ffc3489 100644 --- a/app/services/issues/base_service.rb +++ b/app/services/issues/base_service.rb @@ -1,6 +1,5 @@ module Issues class BaseService < ::BaseService - include Rails.application.routes.url_helpers private @@ -10,9 +9,7 @@ module Issues def execute_hooks(issue, action = 'open') issue_data = issue.to_hook_data - issue_url = project_issue_url(id: issue.iid, - project_id: issue.project, - host: Settings.gitlab['url']) + issue_url = Gitlab::UrlBuilder.new(:issue).build(issue.id) issue_data[:object_attributes].merge!(url: issue_url, action: action) issue.project.execute_hooks(issue_data, :issue_hooks) end -- cgit v1.2.1