mix format

This commit is contained in:
byte[] 2021-09-27 19:18:34 -04:00
parent b1da5afac0
commit 5b6d941a36
2 changed files with 14 additions and 4 deletions

View file

@ -274,7 +274,15 @@ defmodule Philomena.Users.User do
def update_changeset(user, attrs, roles) do
user
|> cast(attrs, [:name, :email, :role, :secondary_role, :hide_default_role, :senior_staff, :bypass_rate_limits])
|> cast(attrs, [
:name,
:email,
:role,
:secondary_role,
:hide_default_role,
:senior_staff,
:bypass_rate_limits
])
|> validate_required([:name, :email, :role])
|> validate_inclusion(:role, ["user", "assistant", "moderator", "admin"])
|> put_assoc(:roles, roles)

View file

@ -5,9 +5,11 @@ defmodule Philomena.Repo.Migrations.ChangeImageScaleOptionType do
alter table(:users) do
add :scale_large_images0, :string, default: "true", null: false
end
execute("update users set scale_large_images0 = (case when scale_large_images then 'true' else 'false' end);")
execute(
"update users set scale_large_images0 = (case when scale_large_images then 'true' else 'false' end);"
)
alter table(:users) do
remove :scale_large_images
end