f1479b56b7
In 8278b763d9
the default behaviour of annotation
has changes, which was causing a lot of noise in diffs. We decided in #17382
that it is better to get rid of the whole annotate gem, and instead let people
look at schema.rb for the columns in a table.
Fixes: #17382
19 lines
388 B
Ruby
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
|