diff options
author | Douwe Maan <douwe@selenight.nl> | 2016-08-19 17:22:59 -0500 |
---|---|---|
committer | Douwe Maan <douwe@selenight.nl> | 2016-08-19 18:24:12 -0500 |
commit | d741303a5992b0d259a125baa62b66ca4df209da (patch) | |
tree | 4540c93a9b208b4e617f88f499e3843db3699069 /app/models/diff_note.rb | |
parent | c711fe15dd2409161702f20a1ccffd861ae798ab (diff) | |
download | gitlab-ce-d741303a5992b0d259a125baa62b66ca4df209da.tar.gz |
Call `set_discussion_id` again in DiffNote `before_validation` because the order is important
Diffstat (limited to 'app/models/diff_note.rb')
-rw-r--r-- | app/models/diff_note.rb | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/app/models/diff_note.rb b/app/models/diff_note.rb index aa54189fea9..c8320ff87fa 100644 --- a/app/models/diff_note.rb +++ b/app/models/diff_note.rb @@ -16,6 +16,9 @@ class DiffNote < Note after_initialize :ensure_original_discussion_id before_validation :set_original_position, :update_position, on: :create before_validation :set_line_code, :set_original_discussion_id + # We need to do this again, because it's already in `Note`, but is affected by + # `update_position` and needs to run after that. + before_validation :set_discussion_id after_save :keep_around_commits class << self |