diff options
author | Douwe Maan <douwe@gitlab.com> | 2015-02-28 19:33:18 +0300 |
---|---|---|
committer | Douwe Maan <douwe@gitlab.com> | 2015-03-03 13:14:32 +0300 |
commit | d57e809cbd56aea8a49c6595663fc4b7250c5a34 (patch) | |
tree | 495d73da8f7edad0852a856774ef907ca6bfac60 /app/models/project_services/emails_on_push_service.rb | |
parent | 85fa334eb6fd2069287a660e6ffa2295ea3a787f (diff) |
Set supported events per project service.
Diffstat (limited to 'app/models/project_services/emails_on_push_service.rb')
-rw-r--r-- | app/models/project_services/emails_on_push_service.rb | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/app/models/project_services/emails_on_push_service.rb b/app/models/project_services/emails_on_push_service.rb index 1b7ce481c1f..21041e08a20 100644 --- a/app/models/project_services/emails_on_push_service.rb +++ b/app/models/project_services/emails_on_push_service.rb @@ -33,9 +33,12 @@ class EmailsOnPushService < Service 'emails_on_push' end + def supported_events + %w(push) + end + def execute(data) - object_kind = data[:object_kind] - return unless object_kind == "push" + return unless supported_events.include?(data[:object_kind]) EmailsOnPushWorker.perform_async(project_id, recipients, data) end |