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
path: root/lib
diff options
context:
space:
mode:
authorVinnie Okada <vokada@mrvinn.com>2015-01-24 21:02:58 +0300
committerVinnie Okada <vokada@mrvinn.com>2015-02-14 21:09:23 +0300
commit76aad9b76ed756ca9ba2cbcdb399c815e542b3ae (patch)
tree7226e0ce64796abbf4848582baed8d173ddecd14 /lib
parent5725b6daad2f403f13112cfcafa5b45ac126c0ca (diff)
Upgrade to Rails 4.1.9
Make the following changes to deal with new behavior in Rails 4.1.2: * Use nested resources to avoid slashes in arguments to path helpers.
Diffstat (limited to 'lib')
-rw-r--r--lib/extracts_path.rb3
-rw-r--r--lib/gitlab/markdown.rb16
-rw-r--r--lib/gitlab/url_builder.rb7
3 files changed, 16 insertions, 10 deletions
diff --git a/lib/extracts_path.rb b/lib/extracts_path.rb
index 19215cfb7e6..6e4ed01e079 100644
--- a/lib/extracts_path.rb
+++ b/lib/extracts_path.rb
@@ -102,7 +102,8 @@ module ExtractsPath
raise InvalidPathError unless @commit
@hex_path = Digest::SHA1.hexdigest(@path)
- @logs_path = logs_file_project_ref_path(@project, @ref, @path)
+ @logs_path = logs_file_namespace_project_ref_path(@project.namespace,
+ @project, @ref, @path)
rescue RuntimeError, NoMethodError, InvalidPathError
not_found!
diff --git a/lib/gitlab/markdown.rb b/lib/gitlab/markdown.rb
index fb0218a2778..a1fd794aed2 100644
--- a/lib/gitlab/markdown.rb
+++ b/lib/gitlab/markdown.rb
@@ -202,7 +202,7 @@ module Gitlab
)
if identifier == "all"
- link_to("@all", project_url(project), options)
+ link_to("@all", namespace_project_url(project.namespace, project), options)
elsif namespace = Namespace.find_by(path: identifier)
url =
if namespace.type == "Group"
@@ -222,7 +222,7 @@ module Gitlab
)
link_to(
render_colored_label(label),
- project_issues_path(project, label_name: label.name),
+ namespace_project_issues_path(project.namespace, project, label_name: label.name),
options
)
end
@@ -255,7 +255,8 @@ module Gitlab
title: "Merge Request: #{merge_request.title}",
class: "gfm gfm-merge_request #{html_options[:class]}"
)
- url = project_merge_request_url(project, merge_request)
+ url = namespace_project_merge_request_url(project.namespace, project,
+ merge_request)
link_to("#{prefix_text}!#{identifier}", url, options)
end
end
@@ -266,8 +267,11 @@ module Gitlab
title: "Snippet: #{snippet.title}",
class: "gfm gfm-snippet #{html_options[:class]}"
)
- link_to("$#{identifier}", project_snippet_url(project, snippet),
- options)
+ link_to(
+ "$#{identifier}",
+ namespace_project_snippet_url(project.namespace, project, snippet),
+ options
+ )
end
end
@@ -280,7 +284,7 @@ module Gitlab
prefix_text = "#{prefix_text}@" if prefix_text
link_to(
"#{prefix_text}#{identifier}",
- project_commit_url(project, commit),
+ namespace_project_commit_url(project.namespace, project, commit),
options
)
end
diff --git a/lib/gitlab/url_builder.rb b/lib/gitlab/url_builder.rb
index 877488d8471..e7153cc3225 100644
--- a/lib/gitlab/url_builder.rb
+++ b/lib/gitlab/url_builder.rb
@@ -17,9 +17,10 @@ module Gitlab
def issue_url(id)
issue = Issue.find(id)
- project_issue_url(id: issue.iid,
- project_id: issue.project,
- host: Gitlab.config.gitlab['url'])
+ namespace_project_issue_url(namespace_id: issue.project.namespace,
+ id: issue.iid,
+ project_id: issue.project,
+ host: Gitlab.config.gitlab['url'])
end
end
end