mirror of
https://github.com/ash-project/ash.git
synced 2024-09-20 13:33:20 +12:00
improvement: properly honor ecto type init
callback
This commit is contained in:
parent
d9bacc1554
commit
5d85c5be14
2 changed files with 8 additions and 3 deletions
|
@ -38,7 +38,9 @@ defmodule Ash.Type.DateTime do
|
|||
storage_type
|
||||
end
|
||||
|
||||
def storage_type(_), do: :utc_datetime
|
||||
def storage_type(_constraints) do
|
||||
:utc_datetime
|
||||
end
|
||||
|
||||
@impl true
|
||||
def generator(_constraints) do
|
||||
|
|
|
@ -949,9 +949,12 @@ defmodule Ash.Type do
|
|||
def init(opts) do
|
||||
constraints = @parent.constraints()
|
||||
|
||||
{:ok, opts} =
|
||||
opts
|
||||
|> Keyword.take(Keyword.keys(constraints))
|
||||
|> @parent.init()
|
||||
|
||||
opts
|
||||
|> Keyword.take(Keyword.keys(constraints))
|
||||
|> @parent.init()
|
||||
end
|
||||
|
||||
@impl true
|
||||
|
|
Loading…
Reference in a new issue