EctoEnum - Ecto extension to support enums in Ecto models
This library is for defining Ecto enums (which are
Ecto.Types) backed by
string, or user-defined types storage. User-defined types only work with PostgreSQL at the moment.
Usage looks like:
# lib/my_app/ecto_enums.ex import EctoEnum defenum StatusEnum, registered: 0, active: 1, inactive: 2, archived: 3
defmodule User do use Ecto.Schema schema "users" do field :status, StatusEnum end end
To learn more, check it out on Github.
This library has just been updated to v1.3.0 to add features like
useing and string-backed enums!
Hope you guys like it I and look forward to your feedback/comments!