Skip to content

Commit

Permalink
feat: add not in list fix
Browse files Browse the repository at this point in the history
  • Loading branch information
MikaAK committed Jul 26, 2024
1 parent 829e819 commit 2d22d3b
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/query_builder/schema/comparison_filter.ex
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,10 @@ defmodule EctoShorts.QueryBuilder.Schema.ComparisonFilter do
where(query, [scm], not is_nil(field(scm, ^filter_field)))
end

defp build_subfield_filter(query, filter_field, :!=, val) when is_list(val) do
where(query, [scm], field(scm, ^filter_field) not in ^val)

Check warning on line 66 in lib/query_builder/schema/comparison_filter.ex

View check run for this annotation

Codecov / codecov/patch

lib/query_builder/schema/comparison_filter.ex#L66

Added line #L66 was not covered by tests
end

defp build_subfield_filter(query, filter_field, :!=, {:lower, val}) do
where(query, [scm], fragment("lower(?)", field(scm, ^filter_field)) != ^val)
end
Expand Down

0 comments on commit 2d22d3b

Please sign in to comment.