From: Roger Braun Date: Tue, 20 Jun 2017 14:02:17 +0000 (+0200) Subject: Use more efficient query. X-Git-Url: https://git.squeep.com/?a=commitdiff_plain;h=14a9dd468b1f445fa0fb49ab222d51eaa0e98faf;p=akkoma Use more efficient query. --- 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