Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove redundant validate_attr case. #5965

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions lib/mix/phoenix/schema.ex
Original file line number Diff line number Diff line change
Expand Up @@ -425,7 +425,7 @@ defmodule Mix.Phoenix.Schema do
mix phx.gen.schema Comment comments body:text status:enum:published:unpublished
"""

defp validate_attr!({name, :datetime}), do: validate_attr!({name, :naive_datetime})
defp validate_attr!({name, :datetime}), do: {name, :naive_datetime}
ShPakvel marked this conversation as resolved.
Show resolved Hide resolved

defp validate_attr!({name, :array}) do
Mix.raise("""
Expand All @@ -438,7 +438,6 @@ defmodule Mix.Phoenix.Schema do

defp validate_attr!({_name, :enum}), do: Mix.raise(@enum_missing_value_error)
defp validate_attr!({_name, type} = attr) when type in @valid_types, do: attr
defp validate_attr!({_name, {:enum, _vals}} = attr), do: attr
defp validate_attr!({_name, {type, _}} = attr) when type in @valid_types, do: attr

defp validate_attr!({_, type}) do
Expand Down