+
+ @spec exclude_type(query, String.t()) :: query
+ def exclude_type(query \\ Activity, activity_type) do
+ from(
+ activity in query,
+ where: fragment("(?)->>'type' != ?", activity.data, ^activity_type)
+ )
+ end
+
+ def exclude_authors(query \\ Activity, actors) do
+ from(activity in query, where: activity.actor not in ^actors)
+ end