Skip to content

Commit

Permalink
Use timestamp_type from config in more places
Browse files Browse the repository at this point in the history
  • Loading branch information
rhcarvalho committed Apr 28, 2024
1 parent bdd4f68 commit a0bd269
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion priv/templates/phx.gen.auth/schema.ex
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ defmodule <%= inspect schema.module %> do
field :email, :string
field :password, :string, virtual: true, redact: true
field :hashed_password, :string, redact: true
field :confirmed_at, :naive_datetime
field :confirmed_at, <%= schema.timestamp_type %>

timestamps(<%= if schema.timestamp_type != :naive_datetime, do: "type: #{inspect schema.timestamp_type}" %>)
end
Expand Down
2 changes: 1 addition & 1 deletion priv/templates/phx.gen.auth/schema_token.ex
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ defmodule <%= inspect schema.module %>Token do
field :sent_to, :string
belongs_to :<%= schema.singular %>, <%= inspect schema.module %>

timestamps(updated_at: false)
timestamps(<%= if schema.timestamp_type != :naive_datetime, do: "type: #{inspect schema.timestamp_type}, " %>updated_at: false)
end

@doc """
Expand Down

0 comments on commit a0bd269

Please sign in to comment.