Commit 57484801 authored by Mehmet Emin INAC's avatar Mehmet Emin INAC

Mark Vulnerabilities::Flag#created_at as read-only

parent 0068c3a1
......@@ -4,6 +4,10 @@ module Vulnerabilities
class Flag < ApplicationRecord
self.table_name = 'vulnerability_flags'
# This is necessary to prevent updating the
# created_at attribute with upsert queries.
attr_readonly(:created_at)
belongs_to :finding, class_name: 'Vulnerabilities::Finding', foreign_key: 'vulnerability_occurrence_id', inverse_of: :vulnerability_flags, optional: false
validates :origin, length: { maximum: 255 }
......
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