Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDouwe Maan <douwe@gitlab.com>2015-07-29 13:03:53 +0300
committerDouwe Maan <douwe@gitlab.com>2015-07-29 13:03:53 +0300
commit05cca9342b3cff4e9f2785a062822cd3af9fcdd4 (patch)
treeacb19717f49daf1009c2a7b349017f0598d4f83a /app/models
parenta784b996b3071cfe1807b1108316143dbc64492f (diff)
Use URL helpers
Diffstat (limited to 'app/models')
-rw-r--r--app/models/group.rb4
-rw-r--r--app/models/project.rb2
-rw-r--r--app/models/user.rb3
3 files changed, 5 insertions, 4 deletions
diff --git a/app/models/group.rb b/app/models/group.rb
index adcbbec465e..885d3b1e5ab 100644
--- a/app/models/group.rb
+++ b/app/models/group.rb
@@ -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
diff --git a/app/models/project.rb b/app/models/project.rb
index ff372ea9aa5..0608133b2cb 100644
--- a/app/models/project.rb
+++ b/app/models/project.rb
@@ -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
diff --git a/app/models/user.rb b/app/models/user.rb
index 00a37cd9135..6dd2271abe2 100644
--- a/app/models/user.rb
+++ b/app/models/user.rb
@@ -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