diff options
author | Heinrich Lee Yu <heinrich@gitlab.com> | 2019-02-06 10:31:46 +0000 |
---|---|---|
committer | Phil Hughes <me@iamphill.com> | 2019-02-06 10:31:46 +0000 |
commit | a04d9ba90c0d1df02f613b7aa01ef598e1ac5b28 (patch) | |
tree | 4a8889592e2290160926ede70aa0cf37bd93519f /app/services/notes | |
parent | c5f1b8346860aa764369a3d156047c9e2c7317ca (diff) | |
download | gitlab-ce-a04d9ba90c0d1df02f613b7aa01ef598e1ac5b28.tar.gz |
Add reply to notes to turn into discussions
Diffstat (limited to 'app/services/notes')
-rw-r--r-- | app/services/notes/build_service.rb | 2 | ||||
-rw-r--r-- | app/services/notes/create_service.rb | 4 |
2 files changed, 6 insertions, 0 deletions
diff --git a/app/services/notes/build_service.rb b/app/services/notes/build_service.rb index bae98ede561..541f3e0d23c 100644 --- a/app/services/notes/build_service.rb +++ b/app/services/notes/build_service.rb @@ -15,6 +15,8 @@ module Notes return note end + discussion = discussion.convert_to_discussion! if discussion.can_convert_to_discussion? + params.merge!(discussion.reply_attributes) should_resolve = discussion.resolved? end diff --git a/app/services/notes/create_service.rb b/app/services/notes/create_service.rb index c4546f30235..b975c3a8cb6 100644 --- a/app/services/notes/create_service.rb +++ b/app/services/notes/create_service.rb @@ -34,6 +34,10 @@ module Notes end if !only_commands && note.save + if note.part_of_discussion? && note.discussion.can_convert_to_discussion? + note.discussion.convert_to_discussion!.save(touch: false) + end + todo_service.new_note(note, current_user) clear_noteable_diffs_cache(note) Suggestions::CreateService.new(note).execute |