Skip to content

Commit

Permalink
Update TODOs
Browse files Browse the repository at this point in the history
  • Loading branch information
josevalim committed Oct 1, 2023
1 parent 4fff8f3 commit 31b7e2e
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 15 deletions.
2 changes: 1 addition & 1 deletion lib/ecto/changeset.ex
Original file line number Diff line number Diff line change
Expand Up @@ -729,7 +729,7 @@ defmodule Ecto.Changeset do
opts

empty_values != empty_values() ->
# TODO: Remove changeset.empty_values field
# TODO: Remove changeset.empty_values field in Ecto v3.14
IO.warn(
"Changing the empty_values field of Ecto.Changeset is deprecated, " <>
"please pass the :empty_values option on cast instead"
Expand Down
4 changes: 1 addition & 3 deletions lib/ecto/schema.ex
Original file line number Diff line number Diff line change
Expand Up @@ -2244,9 +2244,7 @@ defmodule Ecto.Schema do
def __after_compile__(%{module: module} = env, _) do
# If we are compiling code, we can validate associations now,
# as the Elixir compiler will solve dependencies.
#
# TODO: Use Code.can_await_module_compilation?/0 from Elixir v1.11+.
if Process.info(self(), :error_handler) == {:error_handler, Kernel.ErrorHandler} do
if Code.can_await_module_compilation?() do
for name <- module.__schema__(:associations) do
assoc = module.__schema__(:association, name)

Expand Down
13 changes: 2 additions & 11 deletions lib/mix/ecto.ex
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,7 @@ defmodule Mix.Ecto do
defp parse_repo([], []) do
apps =
if apps_paths = Mix.Project.apps_paths() do
# TODO: Use the proper ordering from Mix.Project.deps_apps
# when we depend on Elixir v1.11+.
apps_paths |> Map.keys() |> Enum.sort()
Enum.filter(Mix.Project.deps_apps(), &is_map_key(apps_paths, &1))
else
[Mix.Project.config()[:app]]
end
Expand Down Expand Up @@ -64,14 +62,7 @@ defmodule Mix.Ecto do
def ensure_repo(repo, args) do
# Do not pass the --force switch used by some tasks downstream
args = List.delete(args, "--force")

# TODO: Use only app.config when we depend on Elixir v1.11+.
if Code.ensure_loaded?(Mix.Tasks.App.Config) do
Mix.Task.run("app.config", args)
else
Mix.Task.run("loadpaths", args)
"--no-compile" not in args && Mix.Task.run("compile", args)
end
Mix.Task.run("app.config", args)

case Code.ensure_compiled(repo) do
{:module, _} ->
Expand Down

0 comments on commit 31b7e2e

Please sign in to comment.