Ecto v1.1.0 Ecto.Model
Warning: this module is currently deprecated. Instead
use Ecto.Schema
and the functions in the Ecto
module.
Ecto.Model
is built on top of Ecto.Schema
. See
Ecto.Schema
for documentation on the schema/2
macro,
as well which fields, associations, types are available.
Using
When used, Ecto.Model
imports itself, as well as the functions
in Ecto.Changeset
and Ecto.Query
.
All the modules existing in Ecto.Model.*
are brought in too:
use Ecto.Model.Callbacks
- provides lifecycle callbacksuse Ecto.Model.OptimisticLock
- makes theoptimistic_lock/1
macro available
However, you can avoid using Ecto.Model
altogether in favor
of cherry-picking any of the functionality above.
Summary
Types
t :: %atom{}