Skip to content

Commit

Permalink
update get_by_email to search on the emailHash, #29
Browse files Browse the repository at this point in the history
  • Loading branch information
SimonLab committed Dec 3, 2019
1 parent 027bc20 commit 3e7e9f9
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lib/app/ctx.ex
Original file line number Diff line number Diff line change
Expand Up @@ -227,15 +227,17 @@ defmodule App.Ctx do
** (Ecto.NoResultsError)
"""
def get_person!(id) do
def get_person!(id) do
Repo.get!(Person, id)
# |> Repo.preload(sessions: :person)
end

@doc """
Get a person by email
"""
def get_person_by_email(email), do: Repo.get_by(Person, email: email)
def get_person_by_email(email) do
Repo.get_by(Person, email_hash: email)
end

@doc """
Creates a person.
Expand Down

0 comments on commit 3e7e9f9

Please sign in to comment.