1 defmodule Pleroma.Activity do
3 alias Pleroma.{Repo, Activity}
8 field :local, :boolean, default: true
13 def get_by_ap_id(ap_id) do
14 Repo.one(from activity in Activity,
15 where: fragment("? @> ?", activity.data, ^%{id: ap_id}))
18 def all_by_object_ap_id(ap_id) do
19 Repo.all(from activity in Activity,
20 where: fragment("? @> ?", activity.data, ^%{object: %{id: ap_id}}))
23 def get_create_activity_by_object_ap_id(ap_id) do
24 Repo.one(from activity in Activity,
25 where: fragment("? @> ?", activity.data, ^%{type: "Create", object: %{id: ap_id}}))