Ash FrameworkAF
Ash Framework3y ago
12 replies
Stefan Wintermeyer

Using code_interface args

When I use
code_interface do
  define_for Office.ToDoList
  define :create, args: [:subject]
end

I have access to Office.ToDoList.Task.create!("test") but not to Office.ToDoList.Task.create!(%{subject: "test2"}). For the later one to work I have to use define :create but then the first version doesn't work.

Is there a way to have access to both versions or would that be a misuse of the code_interface concept?
Was this page helpful?