From ee1090e2b2bc7b3762f6e2775f3fd15e92ae212b Mon Sep 17 00:00:00 2001 From: Gabriel Mazetto Date: Fri, 15 Apr 2016 08:08:22 -0300 Subject: Added System Hooks for push and tag_push Code is based on Project Webhooks, removing deprecations and without commits listing. --- app/models/project.rb | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) (limited to 'app/models/project.rb') diff --git a/app/models/project.rb b/app/models/project.rb index 8f20922e3c5..e7dac23a122 100644 --- a/app/models/project.rb +++ b/app/models/project.rb @@ -831,8 +831,8 @@ class Project < ActiveRecord::Base end end - def hook_attrs - { + def hook_attrs(backward: true) + attrs = { name: name, description: description, web_url: web_url, @@ -843,12 +843,19 @@ class Project < ActiveRecord::Base visibility_level: visibility_level, path_with_namespace: path_with_namespace, default_branch: default_branch, - # Backward compatibility - homepage: web_url, - url: url_to_repo, - ssh_url: ssh_url_to_repo, - http_url: http_url_to_repo } + + # Backward compatibility + if backward + attrs.merge!({ + homepage: web_url, + url: url_to_repo, + ssh_url: ssh_url_to_repo, + http_url: http_url_to_repo + }) + end + + attrs end # Reset events cache related to this project -- cgit v1.2.1