Created
December 22, 2015 21:14
-
-
Save cdegroot/932dacc8358d36c526e5 to your computer and use it in GitHub Desktop.
This file contains 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
defp store_if_new_user(user) do | |
alias Clueless.User | |
email = user.email | |
unless Repo.get_by(User, email: email) do | |
Repo.insert(User.changeset(%User{}, %{email: email})) | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment