Skip to content

Commit

Permalink
Add default query function for select filter
Browse files Browse the repository at this point in the history
  • Loading branch information
Flo0807 committed Dec 8, 2023
1 parent 90bfa43 commit ad9cf13
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions lib/backpex/filters/select.ex
Original file line number Diff line number Diff line change
Expand Up @@ -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) =
Expand Down

0 comments on commit ad9cf13

Please sign in to comment.