diff options
Diffstat (limited to 'app/models/project_services/emails_on_push_service.rb')
-rw-r--r-- | app/models/project_services/emails_on_push_service.rb | 8 |
1 files changed, 6 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 79285cbd26d..23dc0bc3790 100644 --- a/app/models/project_services/emails_on_push_service.rb +++ b/app/models/project_services/emails_on_push_service.rb @@ -12,14 +12,18 @@ class EmailsOnPushService < Service 'Email the commits and diff of each push to a list of recipients.' end - def to_param + def self.to_param 'emails_on_push' end - def supported_events + def self.supported_events %w(push tag_push) end + def self.event_names + self.supported_events.map { |event| "#{event}_events" } + end + def execute(push_data) return unless supported_events.include?(push_data[:object_kind]) |