Commit 93938090 authored by Bruno Albuquerque's avatar Bruno Albuquerque

Use project methods instead of attributes.

- This should work correctly in all cases now.
- Added a new project method that returns the web url for a project without
  the scheme prefix.
parent 02822f74
......@@ -201,6 +201,10 @@ class Project < ActiveRecord::Base
[Gitlab.config.gitlab.url, path_with_namespace].join("/")
end
def web_url_without_scheme
[Gitlab.config.gitlab.host, path_with_namespace].join("/")
end
def build_commit_note(commit)
notes.new(commit_id: commit.id, noteable_type: "Commit")
end
......
......@@ -3,7 +3,7 @@
-# Go repository retrieval support.
- if controller_name == 'projects' && action_name == 'show'
%meta{name: "go-import", content: "#{Gitlab.config.gitlab.host}/#{@project.namespace.path}/#{@project.path} git http://#{Gitlab.config.gitlab.host}/#{@project.namespace.path}/#{@project.path}.git"}
%meta{name: "go-import", content: "#{@project.web_url_without_scheme} git #{@project.web_url}.git"}
%title
= "#{title} | " if defined?(title)
......
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