fix: don't raise error on keyword input to create interface

This commit is contained in:
Zach Daniel 2024-04-08 08:41:33 -04:00
parent 6d3b00f77f
commit c31fbc9c3e
2 changed files with 5 additions and 1 deletions

View file

@ -496,7 +496,7 @@ defmodule Ash.CodeInterface do
unquote(Macro.escape(interface_options))
)},
else:
{params_or_opts,
{Map.new(params_or_opts),
Spark.Options.validate!(
opts,
unquote(Macro.escape(interface_options))

View file

@ -206,4 +206,8 @@ defmodule Ash.Test.CodeInterfaceTest do
assert User.create!().first_name == "fred"
assert User.create!("joe").first_name == "joe"
end
test "it handles keyword inputs properly" do
assert User.create!("fred", [last_name: "weasley"], [actor: nil])
end
end