Skip to content

Commit

Permalink
Update Filtrex.query spec type to allow Queryable values (#64)
Browse files Browse the repository at this point in the history
While the docs and var names for this function make it clear that the
first argument can be any ecto module, the spec type requires a
`Query.t`, instead of the more permissive `Queryable.t`. This can cause
issues on projects using dialyzer for static analysis.
  • Loading branch information
mulias committed May 15, 2020
1 parent b8ae52f commit 392a87a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/filtrex.ex
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ defmodule Filtrex do
Filtrex.query(query, filter, allow_empty: true)
```
"""
@spec query(Ecto.Query.t, Filtrex.t, Keyword.t) :: Ecto.Query.t
@spec query(Ecto.Queryable.t, Filtrex.t, Keyword.t) :: Ecto.Query.t
def query(queryable, filter, opts \\ [allow_empty: true])
def query(queryable, %Filtrex{empty: true}, opts) do
if opts[:allow_empty] do
Expand Down

0 comments on commit 392a87a

Please sign in to comment.