2018-11-18 11:00:15 +05:30
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2019-07-07 11:18:12 +05:30
|
|
|
class PushEventPayload < ApplicationRecord
|
2021-03-11 19:13:27 +05:30
|
|
|
extend SuppressCompositePrimaryKeyWarning
|
|
|
|
|
2017-09-10 17:25:29 +05:30
|
|
|
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
|
2019-12-04 20:38:33 +05:30
|
|
|
|
2021-06-08 01:23:25 +05:30
|
|
|
PushEventPayload.prepend_mod_with('PushEventPayload')
|