From c581a430730ff178d1fd3cce6fc14a35633c1c99 Mon Sep 17 00:00:00 2001 From: "byte[]" Date: Fri, 4 Oct 2019 18:56:51 -0400 Subject: [PATCH] primitive filtering --- lib/philomena_web/controllers/activity_controller.ex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/philomena_web/controllers/activity_controller.ex b/lib/philomena_web/controllers/activity_controller.ex index be75a3ca..0b1ae92b 100644 --- a/lib/philomena_web/controllers/activity_controller.ex +++ b/lib/philomena_web/controllers/activity_controller.ex @@ -80,7 +80,7 @@ defmodule PhilomenaWeb.ActivityController do Topic |> join(:inner, [t], f in Forum, on: [id: t.forum_id]) |> where([t, _f], t.hidden_from_users == false) - |> where([t, _f], not ilike(t.title, "NSFW")) + |> where([t, _f], fragment("? !~ ?", t.title, "NSFW")) |> where([_t, f], f.access_level == "normal") |> order_by(desc: :last_replied_to_at) |> preload([:forum, last_post: :user])