summaryrefslogtreecommitdiff
path: root/app/models/push_event_payload.rb
blob: 6cdb1cd4fe96852b520508046de1a84656fd0bac (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
class PushEventPayload < ActiveRecord::Base
  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