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

Use URL helpers

parent a784b996
...@@ -17,7 +17,7 @@ require 'carrierwave/orm/activerecord' ...@@ -17,7 +17,7 @@ require 'carrierwave/orm/activerecord'
require 'file_size_validator' require 'file_size_validator'
class Group < Namespace class Group < Namespace
include Gitlab::ConfigHelper include Rails.application.routes.url_helpers
include Referable include Referable
has_many :group_members, dependent: :destroy, as: :source, class_name: 'GroupMember' has_many :group_members, dependent: :destroy, as: :source, class_name: 'GroupMember'
...@@ -64,7 +64,7 @@ class Group < Namespace ...@@ -64,7 +64,7 @@ class Group < Namespace
end end
def web_url def web_url
[gitlab_config.url, "groups", self.path].join('/') group_url(self)
end end
def owners def owners
......
...@@ -316,7 +316,7 @@ class Project < ActiveRecord::Base ...@@ -316,7 +316,7 @@ class Project < ActiveRecord::Base
end end
def web_url def web_url
[gitlab_config.url, path_with_namespace].join('/') namespace_project_url(self.namespace, self)
end end
def web_url_without_protocol def web_url_without_protocol
......
...@@ -67,6 +67,7 @@ class User < ActiveRecord::Base ...@@ -67,6 +67,7 @@ class User < ActiveRecord::Base
include Gitlab::ConfigHelper include Gitlab::ConfigHelper
include Gitlab::CurrentSettings include Gitlab::CurrentSettings
include Rails.application.routes.url_helpers
include Referable include Referable
include Sortable include Sortable
include TokenAuthenticatable include TokenAuthenticatable
...@@ -638,7 +639,7 @@ class User < ActiveRecord::Base ...@@ -638,7 +639,7 @@ class User < ActiveRecord::Base
end end
def web_url def web_url
[gitlab_config.url, "u", self.username].join('/') user_url(self)
end end
def all_emails 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