summaryrefslogtreecommitdiff
path: root/lib/gitlab/email/message
diff options
context:
space:
mode:
authorGrzegorz Bizon <grzegorz.bizon@ntsn.pl>2015-12-11 13:00:24 +0000
committerGrzegorz Bizon <grzegorz.bizon@ntsn.pl>2015-12-11 13:00:24 +0000
commitcbeb06eb420f294b3a406f869f11de554048e93d (patch)
treec411957a1751a40575ad992f93fd7e3e8aa9703f /lib/gitlab/email/message
parent6ffe8a06fdf1ffc40e60a487a730b50c4699907d (diff)
downloadgitlab-ce-cbeb06eb420f294b3a406f869f11de554048e93d.tar.gz
Mix url helpers in into `RepositoryPush`
Diffstat (limited to 'lib/gitlab/email/message')
-rw-r--r--lib/gitlab/email/message/repository_push.rb19
1 files changed, 10 insertions, 9 deletions
diff --git a/lib/gitlab/email/message/repository_push.rb b/lib/gitlab/email/message/repository_push.rb
index c53148d2ed8..a2eb7a70bd2 100644
--- a/lib/gitlab/email/message/repository_push.rb
+++ b/lib/gitlab/email/message/repository_push.rb
@@ -5,6 +5,8 @@ module Gitlab
attr_accessor :recipient
attr_reader :author_id, :ref, :action
+ include Gitlab::Application.routes.url_helpers
+
delegate :namespace, :name_with_namespace, to: :project, prefix: :project
delegate :name, to: :author, prefix: :author
@@ -16,7 +18,6 @@ module Gitlab
@project_id = project_id
@recipient = recipient
@opts = opts.dup
- @urls = Gitlab::Application.routes.url_helpers
@author_id = @opts.delete(:author_id)
@ref = @opts.delete(:ref)
@@ -86,18 +87,18 @@ module Gitlab
def target_url
if @action == :push && commits
if commits.length > 1
- @urls.namespace_project_compare_url(project_namespace,
- project,
- from: Commit.new(compare.base, project),
- to: Commit.new(compare.head, project))
+ namespace_project_compare_url(project_namespace,
+ project,
+ from: Commit.new(compare.base, project),
+ to: Commit.new(compare.head, project))
else
- @urls.namespace_project_commit_url(project_namespace,
- project, commits.first)
+ namespace_project_commit_url(project_namespace,
+ project, commits.first)
end
else
unless @action == :delete
- @urls.namespace_project_tree_url(project_namespace,
- project, ref_name)
+ namespace_project_tree_url(project_namespace,
+ project, ref_name)
end
end
end