Commit 05cca934 authored by Douwe Maan's avatar Douwe Maan

Use URL helpers

parent a784b996
......@@ -17,7 +17,7 @@ require 'carrierwave/orm/activerecord'
require 'file_size_validator'
class Group < Namespace
include Gitlab::ConfigHelper
include Rails.application.routes.url_helpers
include Referable
has_many :group_members, dependent: :destroy, as: :source, class_name: 'GroupMember'
......@@ -64,7 +64,7 @@ class Group < Namespace
end
def web_url
[gitlab_config.url, "groups", self.path].join('/')
group_url(self)
end
def owners
......
......@@ -316,7 +316,7 @@ class Project < ActiveRecord::Base
end
def web_url
[gitlab_config.url, path_with_namespace].join('/')
namespace_project_url(self.namespace, self)
end
def web_url_without_protocol
......
......@@ -67,6 +67,7 @@ class User < ActiveRecord::Base
include Gitlab::ConfigHelper
include Gitlab::CurrentSettings
include Rails.application.routes.url_helpers
include Referable
include Sortable
include TokenAuthenticatable
......@@ -638,7 +639,7 @@ class User < ActiveRecord::Base
end
def web_url
[gitlab_config.url, "u", self.username].join('/')
user_url(self)
end
def all_emails
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment