Activity.Queries: Use correct actor restriction.
authorlain <lain@soykaf.club>
Tue, 26 May 2020 15:46:16 +0000 (17:46 +0200)
committerrinpatch <rinpatch@sdf.org>
Sun, 7 Jun 2020 22:20:13 +0000 (01:20 +0300)
lib/pleroma/activity/queries.ex

index 04593b9fb70f32dcbaf16d291c8a2e56b7827023..633eca0b31095b3a8a03609bc71e3cd8597c32db 100644 (file)
@@ -24,10 +24,7 @@ defmodule Pleroma.Activity.Queries do
 
   @spec by_actor(query, String.t()) :: query
   def by_actor(query \\ Activity, actor) do
-    from(
-      activity in query,
-      where: fragment("(?)->>'actor' = ?", activity.data, ^actor)
-    )
+    from(a in query, where: a.actor == ^actor)
   end
 
   @spec by_author(query, User.t()) :: query