Use URL helpers
This commit is contained in:
parent
a784b996b3
commit
05cca9342b
3 changed files with 5 additions and 4 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue