From 14a9dd468b1f445fa0fb49ab222d51eaa0e98faf Mon Sep 17 00:00:00 2001 From: Roger Braun Date: Tue, 20 Jun 2017 16:02:17 +0200 Subject: [PATCH] Use more efficient query. --- lib/pleroma/activity.ex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/pleroma/activity.ex b/lib/pleroma/activity.ex index d77c88997..f48199cae 100644 --- a/lib/pleroma/activity.ex +++ b/lib/pleroma/activity.ex @@ -12,7 +12,7 @@ defmodule Pleroma.Activity do def get_by_ap_id(ap_id) do Repo.one(from activity in Activity, - where: fragment("? @> ?", activity.data, ^%{id: ap_id})) + where: fragment("(?)->>'id' = ?", activity.data, ^to_string(ap_id))) end def all_by_object_ap_id(ap_id) do -- 2.45.2