Commit 15235ecb authored by Luke Duncalfe's avatar Luke Duncalfe Committed by Matthias Käppler

Reduce number of SQL queries on SystemNote create

parent ed19a0bd
......@@ -13,10 +13,10 @@ module SystemNotes
protected
def create_note(note_summary)
note = Note.create(note_summary.note.merge(system: true))
note.system_note_metadata = SystemNoteMetadata.new(note_summary.metadata) if note_summary.metadata?
note_params = note_summary.note.merge(system: true)
note_params[:system_note_metadata] = SystemNoteMetadata.new(note_summary.metadata) if note_summary.metadata?
note
Note.create(note_params)
end
def content_tag(*args)
......
---
title: Reduce number of SQL queries when creating SystemNotes
merge_request: 59102
author:
type: performance
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