From ad9cf13ac6bb3d950e88a2d6bcce8e0508b40e74 Mon Sep 17 00:00:00 2001 From: Florian Arens <60519307+Flo0807@users.noreply.github.com> Date: Fri, 8 Dec 2023 11:25:25 +0100 Subject: [PATCH] Add default query function for select filter --- lib/backpex/filters/select.ex | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/backpex/filters/select.ex b/lib/backpex/filters/select.ex index 77c4315f..9a1323a1 100644 --- a/lib/backpex/filters/select.ex +++ b/lib/backpex/filters/select.ex @@ -48,6 +48,11 @@ defmodule Backpex.Filters.Select do @behaviour Backpex.Filters.Select + @impl Backpex.Filter + def query(query, attribute, value) do + where(query, [x], field(x, ^attribute) == ^value) + end + @impl Backpex.Filter def render(var!(assigns)) do var!(assigns) =