summaryrefslogtreecommitdiff
path: root/app/models/project.rb
diff options
context:
space:
mode:
authorRobert Speicher <robert@gitlab.com>2015-07-30 21:38:48 +0000
committerRobert Speicher <robert@gitlab.com>2015-07-30 21:38:48 +0000
commita876db48d95588837895e83e92d0cf3f8a129d02 (patch)
treeea6121571eed7bae7b6a8b96d0e2f605d90d6f8e /app/models/project.rb
parent6d6f807b759d13d111202129d8be2c88d7be819f (diff)
parent2a60b8006b1374aec998370f9cfe5b574255712f (diff)
downloadgitlab-ce-a876db48d95588837895e83e92d0cf3f8a129d02.tar.gz
Merge branch 'api-new-attributes' into 'master'
Add project star and fork count, group avatar URL and user/group web URL attributes to API Addresses internal https://dev.gitlab.org/gitlab/gitlabhq/issues/2521. See merge request !1058
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