diff options
Diffstat (limited to 'app/services/notes/create_service.rb')
-rw-r--r-- | app/services/notes/create_service.rb | 17 |
1 files changed, 5 insertions, 12 deletions
diff --git a/app/services/notes/create_service.rb b/app/services/notes/create_service.rb index cdd765c85eb..61d66a26932 100644 --- a/app/services/notes/create_service.rb +++ b/app/services/notes/create_service.rb @@ -3,17 +3,10 @@ module Notes def execute merge_request_diff_head_sha = params.delete(:merge_request_diff_head_sha) - note = project.notes.new(params) - note.author = current_user - note.system = false - - if note.award_emoji? - noteable = note.noteable - if noteable.user_can_award?(current_user, note.award_emoji_name) - todo_service.new_award_emoji(noteable, current_user) - return noteable.create_award_emoji(note.award_emoji_name, current_user) - end - end + note = Note.new(params) + note.project = project + note.author = current_user + note.system = false # We execute commands (extracted from `params[:note]`) on the noteable # **before** we save the note because if the note consists of commands @@ -47,7 +40,7 @@ module Notes note.errors.add(:commands_only, 'Commands applied') end - note.commands_changes = command_params.keys + note.commands_changes = command_params end note |