Add updated_by information for entity journal updates

This commit is contained in:
Alexander Meindl 2023-01-23 15:28:30 +01:00
parent 51109b29b4
commit ad567c84fa

View File

@ -23,7 +23,9 @@ class AdditionalsJournalsController < ApplicationController
def update def update
return render_403 unless @journal.editable_by? User.current return render_403 unless @journal.editable_by? User.current
@journal.safe_attributes = params[:journal] journal_attributes = params[:journal]
journal_attributes[:updated_by] = User.current
@journal.safe_attributes = journal_attributes
@journal.save @journal.save
@journal.destroy if @journal.details.empty? && @journal.notes.blank? @journal.destroy if @journal.details.empty? && @journal.notes.blank?
respond_to do |format| respond_to do |format|