Object: Use ap_id column.
This commit is contained in:
parent
8785ad8d90
commit
0ff1985304
@ -70,8 +70,8 @@ defmodule Pleroma.Activity do
|
||||
join(query, join_type, [activity], o in Object,
|
||||
on:
|
||||
fragment(
|
||||
"(?->>'id') = COALESCE(?->'object'->>'id', ?->>'object')",
|
||||
o.data,
|
||||
"? = COALESCE(?->'object'->>'id', ?->>'object')",
|
||||
o.ap_id,
|
||||
activity.data,
|
||||
activity.data
|
||||
),
|
||||
|
@ -67,7 +67,7 @@ defmodule Pleroma.Object do
|
||||
def get_by_ap_id(nil), do: nil
|
||||
|
||||
def get_by_ap_id(ap_id) do
|
||||
Repo.one(from(object in Object, where: fragment("(?)->>'id' = ?", object.data, ^ap_id)))
|
||||
Repo.one(from(object in Object, where: object.ap_id == ^ap_id))
|
||||
end
|
||||
|
||||
defp warn_on_no_object_preloaded(ap_id) do
|
||||
|
Loading…
Reference in New Issue
Block a user