forked from shibao/cannery
update deps
This commit is contained in:
@ -17,7 +17,7 @@ defmodule Cannery.Accounts.Invite do
|
||||
|
||||
has_many :users, User
|
||||
|
||||
timestamps()
|
||||
timestamps(type: :utc_datetime)
|
||||
end
|
||||
|
||||
@type t :: %__MODULE__{
|
||||
|
@ -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"))
|
||||
|
@ -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__{
|
||||
|
@ -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__{
|
||||
|
@ -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__{
|
||||
|
@ -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
|
||||
|
@ -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__{
|
||||
|
@ -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__{
|
||||
|
@ -20,7 +20,7 @@ defmodule Cannery.Containers.Tag do
|
||||
|
||||
field :user_id, :binary_id
|
||||
|
||||
timestamps()
|
||||
timestamps(type: :utc_datetime)
|
||||
end
|
||||
|
||||
@type t :: %__MODULE__{
|
||||
|
Reference in New Issue
Block a user