Skip to content

Instantly share code, notes, and snippets.

@cdegroot
Created December 22, 2015 21:14
Show Gist options
  • Save cdegroot/932dacc8358d36c526e5 to your computer and use it in GitHub Desktop.
Save cdegroot/932dacc8358d36c526e5 to your computer and use it in GitHub Desktop.
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