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

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

module Abuse
  class Event < ApplicationRecord
    self.table_name = 'abuse_events'

    validates :category, presence: true
    validates :source, presence: true
    validates :user, presence: true, on: :create
    validates :metadata, json_schema: { filename: 'abuse_event_metadata' }, allow_blank: true

    belongs_to :user, inverse_of: :abuse_events
    belongs_to :abuse_report, inverse_of: :abuse_events

    enum category: Enums::Abuse::Category.categories
    enum source: Enums::Abuse::Source.sources
  end
end