active: boolean(),
deactivated: boolean(),
need_approval: boolean(),
- need_confirmed: boolean(),
+ unconfirmed: boolean(),
is_admin: boolean(),
is_moderator: boolean(),
super_users: boolean(),
where(query, [u], u.approval_pending)
end
- defp compose_query({:need_confirmed, _}, query) do
+ defp compose_query({:unconfirmed, _}, query) do
where(query, [u], u.confirmation_pending)
end
end
end
- @filters ~w(local external active deactivated need_approval need_confirmed is_admin is_moderator)
+ @filters ~w(local external active deactivated need_approval unconfirmed is_admin is_moderator)
@spec maybe_parse_filters(String.t()) :: %{required(String.t()) => true} | %{}
defp maybe_parse_filters(filters) when is_nil(filters) or filters == "", do: %{}
insert(:user)
{:ok, _results, total} = Search.user()
- {:ok, [^unconfirmed], count} = Search.user(%{need_confirmed: true})
+ {:ok, [^unconfirmed], count} = Search.user(%{unconfirmed: true})
assert total == 3
assert count == 1
end