summaryrefslogtreecommitdiff
path: root/app/models/diff_discussion.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/models/diff_discussion.rb')
-rw-r--r--app/models/diff_discussion.rb6
1 files changed, 5 insertions, 1 deletions
diff --git a/app/models/diff_discussion.rb b/app/models/diff_discussion.rb
index 642e93f7912..f4d665cf279 100644
--- a/app/models/diff_discussion.rb
+++ b/app/models/diff_discussion.rb
@@ -43,9 +43,13 @@ class DiffDiscussion < Discussion
end
def cache_key
+ positions_json = diff_note_positions.map { |dnp| dnp.position.to_json }
+ positions_sha = Digest::SHA1.hexdigest(positions_json.join(':')) if positions_json.any?
+
[
super,
- Digest::SHA1.hexdigest(position.to_json)
+ Digest::SHA1.hexdigest(position.to_json),
+ positions_sha
].join(':')
end