[Ecto.Type] Add a new embed_as/1 callback to Ecto.Type that allows adapters to control embedding behaviour
[Ecto.Type] Add use Ecto.Type for convenience that implements the new required callbacks
Ecto added a new __using__ block for Ecto.Type which implements the behaviour + the new required functions.
This PR checks if Ecto.Type can be used, and otherwise just implements the @behaviour, to maintain compatibility with Ecto < 3.2.0.
to address the https://github.com/stavro/arc_ecto/pull/120 and https://github.com/stavro/arc_ecto/issues/119
from @Kuret:
https://github.com/elixir-ecto/ecto/blob/d8ae5564a17f5b0a40962d81ef71360560210f12/lib/ecto/type.ex#L83 https://github.com/elixir-ecto/ecto/blob/v3.2.0/CHANGELOG.md
From the Ecto changelog:
Ecto added a new
__using__
block forEcto.Type
which implements the behaviour + the new required functions.This PR checks if
Ecto.Type
can be used, and otherwise just implements the@behaviour
, to maintain compatibility with Ecto< 3.2.0
.