mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
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:
parent
d289b20858
commit
fcc73b441d
@ -67,10 +67,14 @@ class Emoji
|
|||||||
[[global_emoji_cache, :standard], [site_emoji_cache, :custom]].each do |cache, list_key|
|
[[global_emoji_cache, :standard], [site_emoji_cache, :custom]].each do |cache, list_key|
|
||||||
found_emoji =
|
found_emoji =
|
||||||
cache.defer_get_set(normalized_name) do
|
cache.defer_get_set(normalized_name) do
|
||||||
|
[
|
||||||
Emoji
|
Emoji
|
||||||
.public_send(list_key)
|
.public_send(list_key)
|
||||||
.detect { |e| e.name == normalized_name && (!is_toned || (is_toned && e.tonable)) }
|
.detect { |e| e.name == normalized_name && (!is_toned || (is_toned && e.tonable)) },
|
||||||
end
|
]
|
||||||
|
end[
|
||||||
|
0
|
||||||
|
]
|
||||||
|
|
||||||
break if found_emoji
|
break if found_emoji
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user