diff options
author | Douwe Maan <douwe@selenight.nl> | 2017-05-22 15:56:20 -0500 |
---|---|---|
committer | Douwe Maan <douwe@selenight.nl> | 2017-05-23 16:27:30 -0500 |
commit | 6e698b254ecddf23a866d9e98a885912102ccbce (patch) | |
tree | 3ce0ea2a254bb9f6148615295ac2ccce5794cf6b /app | |
parent | 14a0841acda66d896b3a7f4459ec0fc4fc44f7f2 (diff) | |
download | gitlab-ce-6e698b254ecddf23a866d9e98a885912102ccbce.tar.gz |
Fix specsdm-outdated-system-note
Diffstat (limited to 'app')
-rw-r--r-- | app/models/note.rb | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/app/models/note.rb b/app/models/note.rb index b4228cc6492..fc8baa66b2f 100644 --- a/app/models/note.rb +++ b/app/models/note.rb @@ -121,7 +121,7 @@ class Note < ActiveRecord::Base end def grouped_diff_discussions(diff_refs = nil) - groups = Hash.new { |h, k| h[k] = [] } + groups = {} diff_notes.fresh.discussions.each do |discussion| line_code = @@ -131,7 +131,10 @@ class Note < ActiveRecord::Base discussion.original_line_code end - groups[line_code] << discussion if line_code + if line_code + discussions = groups[line_code] ||= [] + discussions << discussion + end end groups |