Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
a93ccf07
Commit
a93ccf07
authored
Jan 10, 2018
by
Lin Jen-Shin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Properly cleaning up memoized values
parent
4f00a051
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
3 deletions
+5
-3
app/models/concerns/resolvable_discussion.rb
app/models/concerns/resolvable_discussion.rb
+5
-3
No files found.
app/models/concerns/resolvable_discussion.rb
View file @
a93ccf07
...
@@ -44,7 +44,9 @@ module ResolvableDiscussion
...
@@ -44,7 +44,9 @@ module ResolvableDiscussion
end
end
def
first_note
def
first_note
notes
.
first
strong_memoize
(
:first_note
)
do
notes
.
first
end
end
end
def
first_note_to_resolve
def
first_note_to_resolve
...
@@ -102,8 +104,8 @@ module ResolvableDiscussion
...
@@ -102,8 +104,8 @@ module ResolvableDiscussion
# Set the notes array to the updated notes
# Set the notes array to the updated notes
@notes
=
notes_relation
.
fresh
.
to_a
# rubocop:disable Gitlab/ModuleWithInstanceVariables
@notes
=
notes_relation
.
fresh
.
to_a
# rubocop:disable Gitlab/ModuleWithInstanceVariables
self
.
class
.
memoized_values
.
each
do
|
var
|
self
.
class
.
memoized_values
.
each
do
|
name
|
instance_variable_set
(
:"@
#{
var
}
"
,
nil
)
clear_memoization
(
name
)
end
end
end
end
end
end
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment