Commit 6f4b4fd9 authored by Robert Speicher's avatar Robert Speicher

Merge branch 'fix_emojis_not_showing_in_autocomplete' into 'master'

Fix emoji aliases not showing in autocomplete

closes #14948 

See merge request !3595
parents c52c1922 1d1ca8b9
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -5,12 +5,23 @@ namespace :gemojione do
require 'json'
dir = Gemojione.index.images_path
digests = []
aliases = Hash.new { |hash, key| hash[key] = [] }
aliases_path = File.join(Rails.root, 'fixtures', 'emojis', 'aliases.json')
digests = AwardEmoji.emojis.map do |name, emoji_hash|
JSON.parse(File.read(aliases_path)).each do |alias_name, real_name|
aliases[real_name] << alias_name
end
AwardEmoji.emojis.map do |name, emoji_hash|
fpath = File.join(dir, "#{emoji_hash['unicode']}.png")
digest = Digest::SHA256.file(fpath).hexdigest
{ name: name, unicode: emoji_hash['unicode'], digest: digest }
digests << { name: name, unicode: emoji_hash['unicode'], digest: digest }
aliases[name].each do |alias_name|
digests << { name: alias_name, unicode: emoji_hash['unicode'], digest: digest }
end
end
out = File.join(Rails.root, 'fixtures', 'emojis', 'digests.json')
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment