mirror of
https://github.com/philomena-dev/philomena.git
synced 2024-11-27 13:47:58 +01:00
mix format
This commit is contained in:
parent
b1da5afac0
commit
5b6d941a36
2 changed files with 14 additions and 4 deletions
|
@ -274,7 +274,15 @@ defmodule Philomena.Users.User do
|
||||||
|
|
||||||
def update_changeset(user, attrs, roles) do
|
def update_changeset(user, attrs, roles) do
|
||||||
user
|
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_required([:name, :email, :role])
|
||||||
|> validate_inclusion(:role, ["user", "assistant", "moderator", "admin"])
|
|> validate_inclusion(:role, ["user", "assistant", "moderator", "admin"])
|
||||||
|> put_assoc(:roles, roles)
|
|> put_assoc(:roles, roles)
|
||||||
|
|
|
@ -6,7 +6,9 @@ defmodule Philomena.Repo.Migrations.ChangeImageScaleOptionType do
|
||||||
add :scale_large_images0, :string, default: "true", null: false
|
add :scale_large_images0, :string, default: "true", null: false
|
||||||
end
|
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
|
alter table(:users) do
|
||||||
remove :scale_large_images
|
remove :scale_large_images
|
||||||
|
|
Loading…
Reference in a new issue