summaryrefslogtreecommitdiff
path: root/app/models/project.rb
diff options
context:
space:
mode:
authorDouwe Maan <douwe@gitlab.com>2015-07-31 14:20:28 +0200
committerDouwe Maan <douwe@gitlab.com>2015-07-31 14:20:28 +0200
commitf71d67dda172a996b23b541b0e26c2c7edc06072 (patch)
treeb4df56c135b47897507d30ac855bfc10da03781c /app/models/project.rb
parent66cc712fa516d758ab09f22ffe78b85cb4415740 (diff)
parenta51a3fb8ed92a58b375125b19f75c3d4c545571a (diff)
downloadgitlab-ce-add-license.tar.gz
Merge branch 'master' into add-licenseadd-license
Diffstat (limited to 'app/models/project.rb')
-rw-r--r--app/models/project.rb7
1 files changed, 3 insertions, 4 deletions
diff --git a/app/models/project.rb b/app/models/project.rb
index 1800c3a7e01..0921fdfe9b4 100644
--- a/app/models/project.rb
+++ b/app/models/project.rb
@@ -36,7 +36,6 @@ class Project < ActiveRecord::Base
include Gitlab::ConfigHelper
include Gitlab::ShellAdapter
include Gitlab::VisibilityLevel
- include Rails.application.routes.url_helpers
include Referable
include Sortable
@@ -316,7 +315,7 @@ class Project < ActiveRecord::Base
end
def web_url
- [gitlab_config.url, path_with_namespace].join('/')
+ Rails.application.routes.url_helpers.namespace_project_url(self.namespace, self)
end
def web_url_without_protocol
@@ -433,7 +432,7 @@ class Project < ActiveRecord::Base
if avatar.present?
[gitlab_config.url, avatar.url].join
elsif avatar_in_git
- [gitlab_config.url, namespace_project_avatar_path(namespace, self)].join
+ Rails.application.routes.url_helpers.namespace_project_avatar_url(namespace, self)
end
end
@@ -571,7 +570,7 @@ class Project < ActiveRecord::Base
end
def http_url_to_repo
- [gitlab_config.url, '/', path_with_namespace, '.git'].join('')
+ "#{web_url}.git"
end
# Check if current branch name is marked as protected in the system