mirror of
https://github.com/ash-project/ash.git
synced 2024-09-20 13:33:20 +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)
|
||||
right = do_expr(right, false)
|
||||
|
||||
[left, right]
|
||||
|> Ash.Query.Function.GetPath.new()
|
||||
|> case do
|
||||
{:ok, call} ->
|
||||
soft_escape(call, escape?)
|
||||
soft_escape(
|
||||
quote do
|
||||
[unquote(left), unquote(right)]
|
||||
|> Ash.Query.Function.GetPath.new()
|
||||
|> case do
|
||||
{:ok, call} ->
|
||||
call
|
||||
|
||||
{:error, error} ->
|
||||
raise error
|
||||
end
|
||||
{:error, error} ->
|
||||
raise error
|
||||
end
|
||||
end,
|
||||
escape?
|
||||
)
|
||||
end
|
||||
|
||||
def do_expr({{:., _, [_, _]} = left, _, []}, escape?) do
|
||||
|
|
Loading…
Reference in a new issue