Skip to content

Commit

Permalink
fix: parse functions properly
Browse files Browse the repository at this point in the history
  • Loading branch information
zachdaniel committed Oct 10, 2020
1 parent aa891c4 commit bd63343
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
1 change: 1 addition & 0 deletions FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
github: zachdaniel
15 changes: 15 additions & 0 deletions lib/ash/filter/filter.ex
Original file line number Diff line number Diff line change
Expand Up @@ -1052,6 +1052,21 @@ defmodule Ash.Filter do
end)

cond do
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

rel = Ash.Resource.relationship(context.resource, field) ->
context =
context
Expand Down

0 comments on commit bd63343

Please sign in to comment.