mirror of
https://github.com/ash-project/ash.git
synced 2024-09-20 21:43:02 +12:00
fix: properly optimized nested get_path
calls
This commit is contained in:
parent
221280f1f5
commit
97ab3272db
1 changed files with 13 additions and 8 deletions
|
@ -127,15 +127,20 @@ defmodule Ash.Expr do
|
||||||
left = do_expr(left, false)
|
left = do_expr(left, false)
|
||||||
right = do_expr(right, false)
|
right = do_expr(right, false)
|
||||||
|
|
||||||
[left, right]
|
soft_escape(
|
||||||
|
quote do
|
||||||
|
[unquote(left), unquote(right)]
|
||||||
|> Ash.Query.Function.GetPath.new()
|
|> Ash.Query.Function.GetPath.new()
|
||||||
|> case do
|
|> case do
|
||||||
{:ok, call} ->
|
{:ok, call} ->
|
||||||
soft_escape(call, escape?)
|
call
|
||||||
|
|
||||||
{:error, error} ->
|
{:error, error} ->
|
||||||
raise error
|
raise error
|
||||||
end
|
end
|
||||||
|
end,
|
||||||
|
escape?
|
||||||
|
)
|
||||||
end
|
end
|
||||||
|
|
||||||
def do_expr({{:., _, [_, _]} = left, _, []}, escape?) do
|
def do_expr({{:., _, [_, _]} = left, _, []}, escape?) do
|
||||||
|
|
Loading…
Reference in a new issue