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:
authorGabriel Mazetto <gabriel@gitlab.com>2016-05-13 10:21:01 +0300
committerGabriel Mazetto <gabriel@gitlab.com>2016-05-31 17:24:58 +0300
commitaaaed331ba06d14f0e071e0933a250c61caabf94 (patch)
tree2cfdded6acef3d5d38ed35d1d351788864d30d1e /app/models/project_wiki.rb
parentef4fedc18f5e2475aa36cc4327a76a496567c6fc (diff)
Fix hook data for Wiki Page event
Added "wiki" section and removed "repository"
Diffstat (limited to 'app/models/project_wiki.rb')
-rw-r--r--app/models/project_wiki.rb14
1 files changed, 14 insertions, 0 deletions
diff --git a/app/models/project_wiki.rb b/app/models/project_wiki.rb
index 339fb0b9f9d..415393d7368 100644
--- a/app/models/project_wiki.rb
+++ b/app/models/project_wiki.rb
@@ -27,6 +27,10 @@ class ProjectWiki
@project.path_with_namespace + ".wiki"
end
+ def web_url
+ Gitlab::Routing.url_helpers.namespace_project_wiki_url(@project.namespace, @project, :home)
+ end
+
def url_to_repo
gitlab_shell.url_to_repo(path_with_namespace)
end
@@ -141,6 +145,16 @@ class ProjectWiki
wiki
end
+
+ def hook_attrs
+ {
+ web_url: web_url,
+ git_ssh_url: ssh_url_to_repo,
+ git_http_url: http_url_to_repo,
+ path_with_namespace: path_with_namespace,
+ default_branch: default_branch,
+ }
+ end
private