mirror of
https://github.com/ash-project/ash_postgres.git
synced 2024-09-20 13:33:50 +12:00
68c6d7aaf8
fix: various broken behavior from new aggregate work improvement: validate that references refer to relationships closes #99
14 lines
333 B
Elixir
14 lines
333 B
Elixir
defmodule AshPostgres.Test.StringAgg do
|
|
@moduledoc false
|
|
use Ash.Resource.Aggregate.CustomAggregate
|
|
use AshPostgres.CustomAggregate
|
|
|
|
require Ecto.Query
|
|
|
|
def dynamic(opts, binding) do
|
|
Ecto.Query.dynamic(
|
|
[],
|
|
fragment("string_agg(?, ?)", field(as(^binding), ^opts[:field]), ^opts[:delimiter])
|
|
)
|
|
end
|
|
end
|