Skip to content

Commit

Permalink
Fix syntax (#4)
Browse files Browse the repository at this point in the history
* Update filter.ex

* Update filter.ex

* fix missing parenthese
  • Loading branch information
bluzky authored Nov 26, 2020
1 parent b2464e5 commit f5eee7c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/filter.ex
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ defmodule Querie.Filter do
filters
|> Enum.reject(fn
{_, {column, _}} -> String.starts_with?(to_string(column), "_")
{column, _} -> String.starts_with?(to_string(column), "_")
_ -> false
end)
|> Enum.group_by(fn
Expand Down Expand Up @@ -155,7 +156,7 @@ defmodule Querie.Filter do
dynamic([q], ^value in field(q, ^column))
end

def filter(_, {_, nil}}, do: nil
def filter(_, {_, nil}), do: nil

def filter(:contains, {column, value}) do
dynamic([q], like(field(q, ^column), ^"%#{value}%"))
Expand Down

0 comments on commit f5eee7c

Please sign in to comment.