activity: use left join instead of inner join when fetching activities that may or may not have a child object

This commit is contained in:
William Pitcock 2019-03-23 03:13:19 +00:00
parent 332dc1371b
commit 4aa699271c

View file

@ -83,7 +83,7 @@ def get_by_ap_id_with_object(ap_id) do
from(
activity in Activity,
where: fragment("(?)->>'id' = ?", activity.data, ^to_string(ap_id)),
inner_join: o in Object,
left_join: o in Object,
on:
fragment(
"(?->>'id') = COALESCE((? -> 'object'::text) ->> 'id'::text)",