Skip to content

Why does Gearbox.Ecto.transition_changeset/3 return a tuple? #18

@jtdowney

Description

@jtdowney

I wanted to start a discussion before sending a PR. First, I want to say thanks for releasing this. I was trying to find a state machine library to add to a new project and was finding small things I didn't like with the current landscape until I saw gearbox. One minor thing that surprised me was that Gearbox.Ecto.transition_changeset/3 returned a tuple that is either {:ok, changeset} or {:error, changeset}. This differs from what I expected because changesets already contain their error discriminants with valid? and errors. Right now, I am just piping the result to elem(1), so it is only a minor annoyance, but I wanted to open a discussion on a proposed PR to return the changeset without the tuple wrapper.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions