gitlab-org--gitlab-foss/app/models/audit_event.rb
2016-06-03 11:10:17 +02:00

19 lines
388 B
Ruby

class AuditEvent < ActiveRecord::Base
serialize :details, Hash
belongs_to :user, foreign_key: :author_id
validates :author_id, presence: true
validates :entity_id, presence: true
validates :entity_type, presence: true
after_initialize :initialize_details
def initialize_details
self.details = {} if details.nil?
end
def author_name
self.user.name
end
end