summaryrefslogtreecommitdiff
path: root/app/models/audit_event.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/models/audit_event.rb')
-rw-r--r--app/models/audit_event.rb12
1 files changed, 10 insertions, 2 deletions
diff --git a/app/models/audit_event.rb b/app/models/audit_event.rb
index e7cfa30a892..f46803be057 100644
--- a/app/models/audit_event.rb
+++ b/app/models/audit_event.rb
@@ -5,9 +5,9 @@ class AuditEvent < ApplicationRecord
include IgnorableColumns
include BulkInsertSafe
- PARALLEL_PERSISTENCE_COLUMNS = [:author_name, :entity_path, :target_details].freeze
+ PARALLEL_PERSISTENCE_COLUMNS = [:author_name, :entity_path, :target_details, :target_type].freeze
- ignore_column :updated_at, remove_with: '13.4', remove_after: '2020-09-22'
+ ignore_column :type, remove_with: '13.6', remove_after: '2020-11-22'
serialize :details, Hash # rubocop:disable Cop/ActiveRecordSerialize
@@ -29,6 +29,14 @@ class AuditEvent < ApplicationRecord
# https://gitlab.com/groups/gitlab-org/-/epics/2765
after_validation :parallel_persist
+ # Note: After loading records, do not attempt to type cast objects it finds.
+ # We are in the process of deprecating STI (i.e. SecurityEvent) out of AuditEvent.
+ #
+ # https://gitlab.com/gitlab-org/gitlab/-/issues/216845
+ def self.inheritance_column
+ :_type_disabled
+ end
+
def self.order_by(method)
case method.to_s
when 'created_asc'