Commit b722baee authored by Marin Jankovski's avatar Marin Jankovski

Audit and Security event models.

parent cf6b6226
class AuditEvent < ActiveRecord::Base
serialize :details, JSON
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
class SecurityEvent < AuditEvent
end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment