Created
December 14, 2015 13:26
-
-
Save janjiss/4ddce127cbac7b29e035 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| defmodule ElixirStream.RegisterAction do | |
| alias ElixirStream.User | |
| def sign_up(params) do | |
| changeset = User.changeset(%User{}, params) | |
| if changeset.valid? do | |
| user = ElixirStream.Repo.insert(changeset) | |
| {:ok, user} | |
| else | |
| {:error, changeset} | |
| end | |
| end | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment