Use URL helpers

This commit is contained in:
Douwe Maan 2015-07-29 12:03:53 +02:00
parent a784b996b3
commit 05cca9342b
3 changed files with 5 additions and 4 deletions

View file

@ -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

View file

@ -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

View file

@ -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