Skip to content
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion lib/ecto/repo/schema.ex
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,7 @@ defmodule Ecto.Repo.Schema do
%{^key => {idx, ^type, _, _}} ->
{{:placeholder, idx}, placeholder_dump, counter}

%{^key => {_, type, _}} ->
%{^key => {_, type, _, _}} ->
raise ArgumentError,
"a placeholder key can only be used with columns of the same type. " <>
"The key #{inspect(key)} has already been dumped as a #{inspect(type)}"
Expand Down
4 changes: 2 additions & 2 deletions test/ecto/repo_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -960,9 +960,9 @@ defmodule Ecto.RepoTest do
test "Repo.insert_all raises when placeholder key is used for different types" do
placeholders = %{uuid_key: Ecto.UUID.generate()}
ph_key = {:placeholder, :uuid_key}
entries = [%{bid: ph_key, string: ph_key}]
entries = [%{bid: ph_key, str: ph_key}]

assert_raise ArgumentError, fn ->
assert_raise ArgumentError, ~r/a placeholder key can only be used with columns of the same type/, fn ->
TestRepo.insert_all(MySchemaWithBinaryId, entries, placeholders: placeholders)
end
end
Expand Down
Loading