Skip to content

Instantly share code, notes, and snippets.

@fxn
Created September 12, 2015 07:55
Show Gist options
  • Save fxn/9bc9722096f057119d46 to your computer and use it in GitHub Desktop.
Save fxn/9bc9722096f057119d46 to your computer and use it in GitHub Desktop.
defp put_pass_hash(changeset) do
case changeset do
%Ecto.Changeset{valid?: true, changes: %{password: pass}} = chset ->
put_change(chset, :password_hash, Comeonin.Bcrypt.hashpwsalt(pass))
chset -> chset
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment