Welcome to mirror list, hosted at ThFree Co, Russian Federation.

bulk_push_event_payload_service.rb « services « app - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 54157bc23f91c442b25df86161aa121f27e88f5b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
# frozen_string_literal: true

class BulkPushEventPayloadService
  def initialize(event, push_data)
    @event = event
    @push_data = push_data
  end

  def execute
    @event.build_push_event_payload(
      action: @push_data[:action],
      commit_count: 0,
      ref_count: @push_data[:ref_count],
      ref_type: @push_data[:ref_type]
    )

    @event.push_event_payload.tap(&:save!)
  end
end