From 64dd6d061c0a4b2e5a42c0e8289c63206a694836 Mon Sep 17 00:00:00 2001 From: "byte[]" Date: Wed, 13 May 2020 14:09:22 -0400 Subject: [PATCH] fixes #118, alias channel associated tags too --- lib/philomena/tags.ex | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/philomena/tags.ex b/lib/philomena/tags.ex index d7740fe7..66b701e2 100644 --- a/lib/philomena/tags.ex +++ b/lib/philomena/tags.ex @@ -17,6 +17,7 @@ defmodule Philomena.Tags do alias Philomena.Images.Tagging alias Philomena.UserLinks.UserLink alias Philomena.DnpEntries.DnpEntry + alias Philomena.Channels.Channel @spec get_or_create_tags(String.t()) :: List.t() def get_or_create_tags(tag_list) do @@ -214,6 +215,10 @@ defmodule Philomena.Tags do |> where(tag_id: ^tag.id) |> Repo.update_all(set: [tag_id: target_tag.id]) + Channel + |> where(associated_artist_tag_id: ^tag.id) + |> Repo.update_all(set: [associated_artist_tag_id: target_tag.id]) + # Update counter Tag |> where(id: ^tag.id)