projects
/
akkoma
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branch 'cleanup-subscription-controller' into 'develop'
[akkoma]
/
priv
/
repo
/
migrations
/
20200406100225_users_add_emoji.exs
diff --git
a/priv/repo/migrations/20200406100225_users_add_emoji.exs
b/priv/repo/migrations/20200406100225_users_add_emoji.exs
index 9f57abb5c3bac85d9a72bfd0865f9db61be40326..f248108defbd11d8cc1080cd7e3298eba38af5b1 100644
(file)
--- a/
priv/repo/migrations/20200406100225_users_add_emoji.exs
+++ b/
priv/repo/migrations/20200406100225_users_add_emoji.exs
@@
-17,7
+17,10
@@
defmodule Pleroma.Repo.Migrations.UsersPopulateEmoji do
emoji =
user.source_data
|> Map.get("tag", [])
emoji =
user.source_data
|> Map.get("tag", [])
- |> Enum.filter(fn data -> data["type"] == "Emoji" and data["icon"] end)
+ |> Enum.filter(fn
+ %{"type" => "Emoji"} -> true
+ _ -> false
+ end)
|> Enum.reduce(%{}, fn %{"icon" => %{"url" => url}, "name" => name}, acc ->
Map.put(acc, String.trim(name, ":"), url)
end)
|> Enum.reduce(%{}, fn %{"icon" => %{"url" => url}, "name" => name}, acc ->
Map.put(acc, String.trim(name, ":"), url)
end)