Merge branch 'dm-fix-parser-cache' into 'master'
Don't return nil for missing objects from parser cache See merge request !12168
This commit is contained in:
commit
d348702b4f
3 changed files with 6 additions and 2 deletions
4
changelogs/unreleased/dm-fix-parser-cache.yml
Normal file
4
changelogs/unreleased/dm-fix-parser-cache.yml
Normal file
|
@ -0,0 +1,4 @@
|
|||
---
|
||||
title: Don't return nil for missing objects from parser cache
|
||||
merge_request:
|
||||
author:
|
|
@ -171,7 +171,7 @@ module Banzai
|
|||
collection.where(id: to_query).each { |row| cache[row.id] = row }
|
||||
end
|
||||
|
||||
cache.values_at(*ids)
|
||||
cache.values_at(*ids).compact
|
||||
else
|
||||
collection.where(id: ids)
|
||||
end
|
||||
|
|
|
@ -114,7 +114,7 @@ describe Banzai::ReferenceParser::BaseParser, lib: true do
|
|||
expect(hash).to eq({ link => user })
|
||||
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)
|
||||
|
||||
expect(link).to receive(:has_attribute?).
|
||||
|
|
Loading…
Reference in a new issue