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

push_event_payload.rb « models « app - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 441b94e1855708a540e008cde8e2d69462e13927 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
# frozen_string_literal: true

class PushEventPayload < ApplicationRecord
  extend SuppressCompositePrimaryKeyWarning
  include IgnorableColumns

  ignore_columns :event_id_convert_to_bigint, remove_with: '14.4', remove_after: '2021-10-22'

  include ShaAttribute

  belongs_to :event, inverse_of: :push_event_payload

  validates :event_id, :commit_count, :action, :ref_type, presence: true
  validates :commit_title, length: { maximum: 70 }

  sha_attribute :commit_from
  sha_attribute :commit_to

  enum action: {
    created: 0,
    removed: 1,
    pushed: 2
  }

  enum ref_type: {
    branch: 0,
    tag: 1
  }
end

PushEventPayload.prepend_mod_with('PushEventPayload')