mirror of
https://github.com/ash-project/ash_postgres.git
synced 2024-09-20 13:33:50 +12:00
e271a27d3c
fix: fix various problems with the model behind aggregates
13 lines
314 B
Elixir
13 lines
314 B
Elixir
defmodule AshPostgres.Test.StringAgg do
|
|
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
|