• Max Woolf's avatar
    Refactor target_id to use database column · 2a7beec6
    Max Woolf authored
    Currently, target_id which refers to the ID
    of the target of an auditable event is stored
    within a hash. This makes querying and filtering
    expensive and difficult. It also makes type
    enforcement much more complicated.
    
    This commit adds a new column (target_id)
    to audit_events and writes the value to both
    the old details hash and the new database column
    in parallel.
    
    It also refactors all paths within the application
    that write to this value.
    2a7beec6
application_controller.rb 1.21 KB