FIX: Make emoji cache store marshalled objects (#21029)

We only marshal arrays, hashes and sets, which meant that the emojis
here were just getting `to_s`ed.

This is a hack.
This commit is contained in:
Daniel Waterworth 2023-04-10 10:44:11 -05:00 committed by GitHub
parent d289b20858
commit fcc73b441d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -67,10 +67,14 @@ class Emoji
[[global_emoji_cache, :standard], [site_emoji_cache, :custom]].each do |cache, list_key|
found_emoji =
cache.defer_get_set(normalized_name) do
Emoji
.public_send(list_key)
.detect { |e| e.name == normalized_name && (!is_toned || (is_toned && e.tonable)) }
end
[
Emoji
.public_send(list_key)
.detect { |e| e.name == normalized_name && (!is_toned || (is_toned && e.tonable)) },
]
end[
0
]
break if found_emoji
end