Activity: all_non_create_by_object_ap_id_q → by_object_ap_id

This commit is contained in:
Haelwenn (lanodan) Monnier 2019-01-21 06:15:05 +01:00
parent b82c6dc536
commit 75e4c8f0b2
No known key found for this signature in database
GPG Key ID: D5B7A8E43C997DEE
2 changed files with 2 additions and 3 deletions

View File

@ -53,8 +53,7 @@ def all_by_object_ap_id_q(ap_id) do
)
end
# Wrong name, returns all.
def all_non_create_by_object_ap_id_q(ap_id) do
def by_object_ap_id(ap_id) do
from(
activity in Activity,
where:

View File

@ -85,7 +85,7 @@ def swap_object_with_tombstone(object) do
def delete(%Object{data: %{"id" => id}} = object) do
with {:ok, _obj} = swap_object_with_tombstone(object),
Repo.delete_all(Activity.all_non_create_by_object_ap_id_q(id)),
Repo.delete_all(Activity.by_object_ap_id(id)),
{:ok, true} <- Cachex.del(:object_cache, "object:#{id}") do
{:ok, object}
end