update deps

This commit is contained in:
2025-04-05 00:13:01 +00:00
parent 449a92e4b7
commit 37d101a71e
130 changed files with 1748 additions and 12180 deletions

View File

@ -17,7 +17,7 @@ defmodule Cannery.Accounts.Invite do
has_many :users, User
timestamps()
timestamps(type: :utc_datetime)
end
@type t :: %__MODULE__{

View File

@ -21,6 +21,7 @@ defmodule Cannery.Accounts.User do
field :email, :string
field :password, :string, virtual: true
field :hashed_password, :string
field :current_password, :string, virtual: true, redact: true
field :confirmed_at, :naive_datetime
field :role, Ecto.Enum, values: [:admin, :user], default: :user
field :locale, :string
@ -29,7 +30,7 @@ defmodule Cannery.Accounts.User do
belongs_to :invite, Invite
timestamps()
timestamps(type: :utc_datetime)
end
@type t :: %User{
@ -193,6 +194,8 @@ defmodule Cannery.Accounts.User do
"""
@spec validate_current_password(changeset(), String.t()) :: changeset()
def validate_current_password(changeset, password) do
changeset = cast(changeset, %{current_password: password}, [:current_password])
if valid_password?(changeset.data, password),
do: changeset,
else: changeset |> add_error(:current_password, dgettext("errors", "is not valid"))

View File

@ -24,7 +24,7 @@ defmodule Cannery.ActivityLog.ShotRecord do
field :user_id, :binary_id
field :pack_id, :binary_id
timestamps()
timestamps(type: :utc_datetime)
end
@type t :: %__MODULE__{

View File

@ -30,7 +30,7 @@ defmodule Cannery.Ammo.Pack do
field :container_id, :binary_id
field :user_id, :binary_id
timestamps()
timestamps(type: :utc_datetime)
end
@type t :: %__MODULE__{

View File

@ -90,7 +90,7 @@ defmodule Cannery.Ammo.Type do
field :user_id, :binary_id
has_many :packs, Pack
timestamps()
timestamps(type: :utc_datetime)
end
@type t :: %__MODULE__{

View File

@ -15,6 +15,7 @@ defmodule Cannery.Application do
CanneryWeb.Telemetry,
# Start the PubSub system
{Phoenix.PubSub, name: Cannery.PubSub},
{DNSCluster, query: Application.get_env(:cannery, :dns_cluster_query) || :ignore},
# Start the Endpoint (http/https)
CanneryWeb.Endpoint,
# Add Oban

View File

@ -27,7 +27,7 @@ defmodule Cannery.Containers.Container do
many_to_many :tags, Tag, join_through: ContainerTag
timestamps()
timestamps(type: :utc_datetime)
end
@type t :: %__MODULE__{

View File

@ -11,7 +11,7 @@ defmodule Cannery.Containers.ContainerTag do
belongs_to :container, Container
belongs_to :tag, Tag
timestamps()
timestamps(type: :utc_datetime)
end
@type t :: %__MODULE__{

View File

@ -20,7 +20,7 @@ defmodule Cannery.Containers.Tag do
field :user_id, :binary_id
timestamps()
timestamps(type: :utc_datetime)
end
@type t :: %__MODULE__{