BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
0230ca83
Commit
0230ca83
authored
May 22, 2018
by
Jan Provaznik
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Check if note's noteable is not nil when checking resolvability
This can occur when a note is added to a commit and then this commit is deleted.
parent
4d674bd3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
14 additions
and
1 deletion
+14
-1
resolvable_note.rb
app/models/concerns/resolvable_note.rb
+1
-1
jprovazn-fix-resolvable.yml
changelogs/unreleased/jprovazn-fix-resolvable.yml
+5
-0
resolvable_note_spec.rb
spec/models/concerns/resolvable_note_spec.rb
+8
-0
No files found.
app/models/concerns/resolvable_note.rb
View file @
0230ca83
...
...
@@ -32,7 +32,7 @@ module ResolvableNote
# Keep this method in sync with the `potentially_resolvable` scope
def
potentially_resolvable?
RESOLVABLE_TYPES
.
include?
(
self
.
class
.
name
)
&&
noteable
.
supports_resolvable_notes?
RESOLVABLE_TYPES
.
include?
(
self
.
class
.
name
)
&&
noteable
&
.
supports_resolvable_notes?
end
# Keep this method in sync with the `resolvable` scope
...
...
changelogs/unreleased/jprovazn-fix-resolvable.yml
0 → 100644
View file @
0230ca83
---
title
:
Fix resolvable check if note's commit could not be found.
merge_request
:
author
:
type
:
fixed
spec/models/concerns/resolvable_note_spec.rb
View file @
0230ca83
...
...
@@ -326,4 +326,12 @@ describe Note, ResolvableNote do
end
end
end
describe
"#potentially_resolvable?"
do
it
'returns false if noteable could not be found'
do
allow
(
subject
).
to
receive
(
:noteable
).
and_return
(
nil
)
expect
(
subject
.
potentially_resolvable?
).
to
be_falsey
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