Hysen Labs
Open-source project
asiniy/ecto_state_machine avatar
asiniy

ecto_state_machine

State machine pattern for Ecto

100 stars20 forksElixirLicense varies
01
DEEP OPEN-SOURCE ANALYSIS

ecto_state_machine, state machines for Ecto

An Elixir library that brings the state machine pattern to Ecto, using a state database column by default with an option to rename it, tracked against a public roadmap.

02
DEEP OPEN-SOURCE ANALYSIS

The state machine pattern for Ecto

ecto_state_machine implements the state machine pattern for Ecto in Elixir. The library uses a state database column by default, and you can pass a column option to change it. That gives developers control over where the state lives, so the library fits schemas that already use a different column name for the state field. The custom column option is the one usage detail the README spells out.

03
DEEP OPEN-SOURCE ANALYSIS

Where the project stands

A roadmap to 1.0 is the most informative part of the README. Checked off are tests, a custom database column name, a changeset validation method that indicates whether a value is in the correct range, initial value support, continuous integration, status question mark methods, and relying on recent versions of Ecto and Elixir. Still open are introducing the library at elixir-radar and on the author's blog, custom error messages for changesets with gettext translations, a dedicated module instead of requiring everything into the model, bang methods that raise instead of returning an invalid changeset, and a rewrite of the README's own spaghetti description. Most of the 1.0 items are done, with the remaining ones leaning toward polish and distribution.

04
DEEP OPEN-SOURCE ANALYSIS

Contributing

The contribution steps are standard for an Elixir project: install dependencies with mix deps.get, set up the config files, run the migrations for both development and test environments, develop a new feature, write new tests, run mix test, and open a pull request. Nothing unusual, which fits a library still moving toward its 1.0 release. The steps assume a working Elixir setup and otherwise stay routine.

06
DEEP OPEN-SOURCE ANALYSIS

Official sources

07
Community notes

Community notes