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
338d9b25
Commit
338d9b25
authored
7 years ago
by
Douwe Maan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Don't return nil for missing objects from parser cache
parent
5771b946
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
6 additions
and
2 deletions
+6
-2
changelogs/unreleased/dm-fix-parser-cache.yml
changelogs/unreleased/dm-fix-parser-cache.yml
+4
-0
lib/banzai/reference_parser/base_parser.rb
lib/banzai/reference_parser/base_parser.rb
+1
-1
spec/lib/banzai/reference_parser/base_parser_spec.rb
spec/lib/banzai/reference_parser/base_parser_spec.rb
+1
-1
No files found.
changelogs/unreleased/dm-fix-parser-cache.yml
0 → 100644
View file @
338d9b25
---
title
:
Don't return nil for missing objects from parser cache
merge_request
:
author
:
This diff is collapsed.
Click to expand it.
lib/banzai/reference_parser/base_parser.rb
View file @
338d9b25
...
@@ -171,7 +171,7 @@ module Banzai
...
@@ -171,7 +171,7 @@ module Banzai
collection
.
where
(
id:
to_query
).
each
{
|
row
|
cache
[
row
.
id
]
=
row
}
collection
.
where
(
id:
to_query
).
each
{
|
row
|
cache
[
row
.
id
]
=
row
}
end
end
cache
.
values_at
(
*
ids
)
cache
.
values_at
(
*
ids
)
.
compact
else
else
collection
.
where
(
id:
ids
)
collection
.
where
(
id:
ids
)
end
end
...
...
This diff is collapsed.
Click to expand it.
spec/lib/banzai/reference_parser/base_parser_spec.rb
View file @
338d9b25
...
@@ -114,7 +114,7 @@ describe Banzai::ReferenceParser::BaseParser, lib: true do
...
@@ -114,7 +114,7 @@ describe Banzai::ReferenceParser::BaseParser, lib: true do
expect
(
hash
).
to
eq
({
link
=>
user
})
expect
(
hash
).
to
eq
({
link
=>
user
})
end
end
it
'returns an empty Hash when entry does not exist in the database'
do
it
'returns an empty Hash when entry does not exist in the database'
,
:request_store
do
link
=
double
(
:link
)
link
=
double
(
:link
)
expect
(
link
).
to
receive
(
:has_attribute?
).
expect
(
link
).
to
receive
(
:has_attribute?
).
...
...
This diff is collapsed.
Click to expand it.
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