fix: fix dialyzer

This commit is contained in:
Zach Daniel 2020-10-09 20:56:15 -04:00
parent 084857bf83
commit 3c6c60f594
No known key found for this signature in database
GPG key ID: C377365383138D4B
2 changed files with 2 additions and 16 deletions

View file

@ -1104,21 +1104,6 @@ defmodule Ash.Filter do
add_aggregate_expression(context, nested_statement, field, expression)
function_module = get_function(field, Ash.Resource.data_layer_functions(context.resource)) ->
with {:ok, args} <-
hydrate_refs(List.wrap(nested_statement), context.resource, context.aggregates),
{:ok, function} <-
Function.new(
function_module,
args,
%Ref{
relationship_path: context.relationship_path,
resource: context.resource
}
) do
{:ok, Expression.optimized_new(:and, expression, function)}
end
(op_module = get_operator(field, Ash.Resource.data_layer_operators(context.resource))) &&
match?([_, _ | _], nested_statement) ->
with {:ok, [left, right]} <-

View file

@ -143,7 +143,8 @@ defmodule Ash.Resource do
end
@doc "Get a relationship by name or path"
@spec relationship(Ash.resource(), atom | [atom]) :: Ash.relationship() | nil
@spec relationship(Ash.resource(), atom | String.t() | [atom | String.t()]) ::
Ash.relationship() | nil
def relationship(resource, [name]) do
relationship(resource, name)
end