Skip to content

Instantly share code, notes, and snippets.

@nyo16 nyo16/pipe_example.ex
Last active Dec 6, 2018

What would you like to do?
Example pipe operator
def registration_changeset(model, params) do
|> cast(params, [:email, :password])
|> validate_required([:email, :password])
|> validate_format(:email, ~r/^[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,4}$/)
|> unique_constraint(:email)
|> validate_length(:password, min: 8)
|> update_password?()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.