Skip to content

Commit

Permalink
add get_status_verified/0 to person.ex
Browse files Browse the repository at this point in the history
  • Loading branch information
nelsonic committed Mar 2, 2020
1 parent 822ed7b commit 81fa2a9
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions lib/app/ctx/person.ex
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
defmodule App.Ctx.Person do
use Ecto.Schema
import Ecto.Changeset
alias App.Ctx.Status
alias App.Repo

schema "people" do
field :email, Fields.EmailEncrypted
Expand All @@ -17,7 +19,7 @@ defmodule App.Ctx.Person do
field :tag, :id
field :key_id, :integer

has_many :sessions, App.Ctx.Session, on_delete: :delete_all
# has_many :sessions, App.Ctx.Session, on_delete: :delete_all

This comment has been minimized.

Copy link
@nelsonic

nelsonic Mar 2, 2020

Author Member

had to comment out the sessions association because the Email App does not have sessions (yet!)

timestamps()
end

Expand Down Expand Up @@ -69,8 +71,12 @@ defmodule App.Ctx.Person do
end
end

defp get_status_verified() do
Repo.get_by(Status, text: "verified")
end

defp put_email_status_verified(changeset) do
status_verified = App.Ctx.get_status_verified()
status_verified = get_status_verified()

case changeset do
%{valid?: true} ->
Expand Down

0 comments on commit 81fa2a9

Please sign in to comment.