From 4a21ae761634b43c22686111d5d6a79e6700a4ce Mon Sep 17 00:00:00 2001 From: codevictory Date: Sun, 28 Mar 2021 16:22:19 +0300 Subject: [PATCH] Remove performerId. --- lib/runosaari/registration/performer.ex | 6 ++-- .../templates/performer/form.html.eex | 4 --- .../templates/performer/index.html.eex | 2 -- .../templates/performer/show.html.eex | 5 --- .../20210327142456_create_performers.exs | 4 +-- test/runosaari/registration_test.exs | 32 +++++++++++++++---- .../controllers/performer_controller_test.exs | 21 ++++++++++-- 7 files changed, 46 insertions(+), 28 deletions(-) diff --git a/lib/runosaari/registration/performer.ex b/lib/runosaari/registration/performer.ex index fc39459..9cb9601 100644 --- a/lib/runosaari/registration/performer.ex +++ b/lib/runosaari/registration/performer.ex @@ -8,7 +8,6 @@ defmodule Runosaari.Registration.Performer do field :fname, :string field :lname, :string field :notes, :string - field :performerId, :integer field :tel, :string timestamps() @@ -17,9 +16,8 @@ defmodule Runosaari.Registration.Performer do @doc false def changeset(performer, attrs) do performer - |> cast(attrs, [:performerId, :fname, :lname, :email, :tel, :confirmed, :notes]) - |> validate_required([:performerId, :fname, :lname, :email, :tel, :confirmed, :notes]) - |> unique_constraint(:performerId) + |> cast(attrs, [:fname, :lname, :email, :tel, :confirmed, :notes]) + |> validate_required([:fname, :lname, :email, :tel, :confirmed, :notes]) |> unique_constraint(:email) end end diff --git a/lib/runosaari_web/templates/performer/form.html.eex b/lib/runosaari_web/templates/performer/form.html.eex index a2ef60b..b82342c 100644 --- a/lib/runosaari_web/templates/performer/form.html.eex +++ b/lib/runosaari_web/templates/performer/form.html.eex @@ -5,10 +5,6 @@ <% end %> - <%= label f, :performerId %> - <%= number_input f, :performerId %> - <%= error_tag f, :performerId %> - <%= label f, :fname %> <%= text_input f, :fname %> <%= error_tag f, :fname %> diff --git a/lib/runosaari_web/templates/performer/index.html.eex b/lib/runosaari_web/templates/performer/index.html.eex index 48fe984..2a29a64 100644 --- a/lib/runosaari_web/templates/performer/index.html.eex +++ b/lib/runosaari_web/templates/performer/index.html.eex @@ -3,7 +3,6 @@ - @@ -17,7 +16,6 @@ <%= for performer <- @performers do %> - diff --git a/lib/runosaari_web/templates/performer/show.html.eex b/lib/runosaari_web/templates/performer/show.html.eex index 67dd071..f8e601d 100644 --- a/lib/runosaari_web/templates/performer/show.html.eex +++ b/lib/runosaari_web/templates/performer/show.html.eex @@ -2,11 +2,6 @@
Performerid Fname Lname Email
<%= performer.performerId %> <%= performer.fname %> <%= performer.lname %> <%= performer.email %>