summaryrefslogtreecommitdiff
path: root/app/models/legacy_diff_discussion.rb
diff options
context:
space:
mode:
authorDouwe Maan <douwe@selenight.nl>2017-04-08 14:58:08 -0500
committerDouwe Maan <douwe@selenight.nl>2017-04-08 14:58:08 -0500
commit1817f877e19628417dd8209f070386b111de59c4 (patch)
tree597679f8c2e1051f7c6317bb33dc797776c8a3d7 /app/models/legacy_diff_discussion.rb
parenta8339fe1aa95d489e00cb0b79a20557d711639ec (diff)
downloadgitlab-ce-1817f877e19628417dd8209f070386b111de59c4.tar.gz
Some code tweaks
Diffstat (limited to 'app/models/legacy_diff_discussion.rb')
-rw-r--r--app/models/legacy_diff_discussion.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/app/models/legacy_diff_discussion.rb b/app/models/legacy_diff_discussion.rb
index cb2651a03f8..e617ce36f56 100644
--- a/app/models/legacy_diff_discussion.rb
+++ b/app/models/legacy_diff_discussion.rb
@@ -7,6 +7,8 @@
class LegacyDiffDiscussion < Discussion
include DiscussionOnDiff
+ memoized_values << :active
+
def legacy_diff_discussion?
true
end
@@ -15,6 +17,12 @@ class LegacyDiffDiscussion < Discussion
LegacyDiffNote
end
+ def active?(*args)
+ return @active if @active.present?
+
+ @active = first_note.active?(*args)
+ end
+
def collapsed?
!active?
end