batch tagger should resolve aliases and implications

This commit is contained in:
byte[] 2020-01-03 10:43:41 -05:00
parent 8e39c06940
commit 11e908ef14

View file

@ -22,7 +22,10 @@ defmodule PhilomenaWeb.Admin.Batch.TagController do
added_tags =
Tag
|> where([t], t.name in ^added_tag_names)
|> preload([:implied_tags, aliased_tag: :implied_tags])
|> Repo.all()
|> Enum.map(& &1.aliased_tag || &1)
|> Enum.flat_map(&[&1 | &1.implied_tags])
removed_tags =
Tag