Fix cache_collection crashing when given an empty collection (#15921)
* Fix cache_collection crashing when given an empty collection * Add tests
This commit is contained in:
parent
43eff898a0
commit
5027abecd1
4 changed files with 65 additions and 2 deletions
|
@ -16,7 +16,9 @@ class EntityCache
|
|||
end
|
||||
|
||||
def emoji(shortcodes, domain)
|
||||
shortcodes = Array(shortcodes)
|
||||
shortcodes = Array(shortcodes)
|
||||
return [] if shortcodes.empty?
|
||||
|
||||
cached = Rails.cache.read_multi(*shortcodes.map { |shortcode| to_key(:emoji, shortcode, domain) })
|
||||
uncached_ids = []
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue