Ecto extension to support enums in models
embed_as/1
and equal?/2
callbacks for Ecto.Type
modulescreate_type/0
with the drop was not being created.use
ing feature and string-backed enums.use
ing functionality so we can use EctoEnum
or EctoEnum.Postgres
to define Ecto Enums.defenum/2
and defenum/3
without parens.create_type/0
is now reversible and can be used in change
in migration files.defenum/4
added which accepts options for creating a Postgres Enum type in a specified schema.EctoEnum.validate_enum/3
which is a helper function for validating enum values in a changeset.valid_value?/1
to the custom enum which checks if the value passed is a valid enum value.Fix defenum/2
and defenum/3
not accepting variables
Updated tests, dependencies, and addressed new compiler warnings
Finally have official Ecto 2.0 support. The release was delayed because there were changes in Postgrex that broke native Enum support for Postgres. Thankfully, that was addressed by @fishcakez!
__valid_values__()
is automatically defined in your custom Enum module to see all valid values accepted by your custom Enum type