diff options
-rw-r--r-- | app/models/concerns/resolvable_discussion.rb | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/app/models/concerns/resolvable_discussion.rb b/app/models/concerns/resolvable_discussion.rb index 6a2cb80b6d5..7c236369793 100644 --- a/app/models/concerns/resolvable_discussion.rb +++ b/app/models/concerns/resolvable_discussion.rb @@ -44,7 +44,9 @@ module ResolvableDiscussion end def first_note - notes.first + strong_memoize(:first_note) do + notes.first + end end def first_note_to_resolve @@ -102,8 +104,8 @@ module ResolvableDiscussion # Set the notes array to the updated notes @notes = notes_relation.fresh.to_a # rubocop:disable Gitlab/ModuleWithInstanceVariables - self.class.memoized_values.each do |var| - instance_variable_set(:"@#{var}", nil) + self.class.memoized_values.each do |name| + clear_memoization(name) end end end |