diff --git a/lib/pleroma/rule.ex b/lib/pleroma/rule.ex index 341ebc0688..643f0a923e 100644 --- a/lib/pleroma/rule.ex +++ b/lib/pleroma/rule.ex @@ -39,7 +39,10 @@ def get(ids) when is_list(ids) do def get(id), do: Repo.get(__MODULE__, id) - def exists?(id), do: not is_nil(get(id)) + def exists?(id) do + from(r in __MODULE__, where: r.id == ^id) + |> Repo.exists?() + end def create(params) do {:ok, rule} =