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:
parent
332dc1371b
commit
4aa699271c
|
@ -83,7 +83,7 @@ def get_by_ap_id_with_object(ap_id) do
|
||||||
from(
|
from(
|
||||||
activity in Activity,
|
activity in Activity,
|
||||||
where: fragment("(?)->>'id' = ?", activity.data, ^to_string(ap_id)),
|
where: fragment("(?)->>'id' = ?", activity.data, ^to_string(ap_id)),
|
||||||
inner_join: o in Object,
|
left_join: o in Object,
|
||||||
on:
|
on:
|
||||||
fragment(
|
fragment(
|
||||||
"(?->>'id') = COALESCE((? -> 'object'::text) ->> 'id'::text)",
|
"(?->>'id') = COALESCE((? -> 'object'::text) ->> 'id'::text)",
|
||||||
|
|
Loading…
Reference in New Issue