actually count correctly

This commit is contained in:
byte[] 2019-12-15 10:09:43 -05:00
parent 1fbe3bd555
commit 62885b51df

View file

@ -209,7 +209,7 @@ defmodule Philomena.Tags do
new_count = new_count =
Image Image
|> join(:inner, [i], _ in assoc(i, :tags)) |> join(:inner, [i], _ in assoc(i, :tags))
|> where([i, t], i.hidden_from_users == true and t.id == ^target_tag.id) |> where([i, t], i.hidden_from_users == false and t.id == ^target_tag.id)
|> Repo.aggregate(:count, :id) |> Repo.aggregate(:count, :id)
Tag Tag