cleaned up parentheses in schemas

This commit is contained in:
Adam Piontek 2022-08-14 09:22:39 -04:00
parent f28c85e343
commit 6a5d2346ff
5 changed files with 19 additions and 19 deletions

View file

@ -20,19 +20,19 @@ defmodule Shift73k.Accounts.User do
@primary_key {:id, :binary_id, autogenerate: true} @primary_key {:id, :binary_id, autogenerate: true}
@foreign_key_type :binary_id @foreign_key_type :binary_id
schema "users" do schema "users" do
field(:email, :string) field :email, :string
field(:password, :string, virtual: true) field :password, :string, virtual: true
field(:hashed_password, :string) field :hashed_password, :string
field(:confirmed_at, :naive_datetime) field :confirmed_at, :naive_datetime
field(:calendar_slug, :string, default: Ecto.UUID.generate()) field :calendar_slug, :string, default: Ecto.UUID.generate()
field(:role, Ecto.Enum, values: Keyword.keys(@roles), default: :user) field :role, Ecto.Enum, values: Keyword.keys(@roles), default: :user
field(:week_start_at, Ecto.Enum, values: weekdays(), default: :monday) field :week_start_at, Ecto.Enum, values: weekdays(), default: :monday
has_many(:shift_templates, ShiftTemplate) has_many :shift_templates, ShiftTemplate
belongs_to(:fave_shift_template, ShiftTemplate) belongs_to :fave_shift_template, ShiftTemplate
has_many(:shifts, Shift) has_many :shifts, Shift
timestamps() timestamps()
end end

View file

@ -15,10 +15,10 @@ defmodule Shift73k.Accounts.UserToken do
@primary_key {:id, :binary_id, autogenerate: true} @primary_key {:id, :binary_id, autogenerate: true}
@foreign_key_type :binary_id @foreign_key_type :binary_id
schema "users_tokens" do schema "users_tokens" do
field(:token, :binary) field :token, :binary
field(:context, :string) field :context, :string
field(:sent_to, :string) field :sent_to, :string
belongs_to(:user, Shift73k.Accounts.User) belongs_to :user, Shift73k.Accounts.User
timestamps(updated_at: false) timestamps(updated_at: false)
end end

View file

@ -13,7 +13,7 @@ defmodule Shift73k.Shifts.Shift do
field :time_start, :time field :time_start, :time
field :time_end, :time field :time_end, :time
belongs_to(:user, Shift73k.Accounts.User) belongs_to :user, Shift73k.Accounts.User
timestamps() timestamps()
end end

View file

@ -16,8 +16,8 @@ defmodule Shift73k.Shifts.Templates.ShiftTemplate do
field :time_start, :time, default: ~T[09:00:00] field :time_start, :time, default: ~T[09:00:00]
field :time_end, :time, default: ~T[17:00:00] field :time_end, :time, default: ~T[17:00:00]
belongs_to(:user, Shift73k.Accounts.User) belongs_to :user, Shift73k.Accounts.User
has_one(:is_fave_of_user, Shift73k.Accounts.User, foreign_key: :fave_shift_template_id) has_one :is_fave_of_user, Shift73k.Accounts.User, foreign_key: :fave_shift_template_id
timestamps() timestamps()
end end

View file

@ -6,7 +6,7 @@
</h2> </h2>
<p class="lead">Hi <%= @user.email %> &mdash; tell us your new password, please.</p> <p class="lead">Hi <%= @user.email %> &mdash; tell us your new password, please.</p>
<%= form_for @changeset, "#", [phx_change: :validate, phx_submit: :save, novalidate: true, id: "pw_reset_form"], fn f -> %> <.form let={f} for={@changeset} phx-change="validate" phx-submit="save" novalidate id="pw_reset_form">
<%= label f, :password, "New password", class: "form-label" %> <%= label f, :password, "New password", class: "form-label" %>
<div class="inner-addon left-addon mb-3" phx-feedback-for={input_id(f, :password)}> <div class="inner-addon left-addon mb-3" phx-feedback-for={input_id(f, :password)}>
@ -42,7 +42,7 @@
%> %>
</div> </div>
<% end %> </.form>
<p class="mt-3 is-pulled-right"> <p class="mt-3 is-pulled-right">
<%= if allow_registration() do %> <%= if allow_registration() do %>