From 3c6c60f594e7fc1bdd95af306b990c726ba1d563 Mon Sep 17 00:00:00 2001 From: Zach Daniel Date: Fri, 9 Oct 2020 20:56:15 -0400 Subject: [PATCH] fix: fix dialyzer --- lib/ash/filter/filter.ex | 15 --------------- lib/ash/resource.ex | 3 ++- 2 files changed, 2 insertions(+), 16 deletions(-) diff --git a/lib/ash/filter/filter.ex b/lib/ash/filter/filter.ex index ad796bbd..08d6ab49 100644 --- a/lib/ash/filter/filter.ex +++ b/lib/ash/filter/filter.ex @@ -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]} <- diff --git a/lib/ash/resource.ex b/lib/ash/resource.ex index 0e605782..dcb3cfff 100644 --- a/lib/ash/resource.ex +++ b/lib/ash/resource.ex @@ -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