Merge branch 'develop' into feature/tag_feed
[akkoma] / lib / pleroma / activity / queries.ex
index 949f010a81f840368fa8cf41a1f39297b8132104..26bc1099daea092b78ae7b6e5ad9c0c561608183 100644 (file)
@@ -64,4 +64,12 @@ defmodule Pleroma.Activity.Queries do
       where: fragment("(?)->>'type' = ?", activity.data, ^activity_type)
     )
   end
+
+  @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
 end