I am loving the new Ash Framework beta book (and highly recommend it to all). There is so much great material in it and I am enjoying all of the time I spending with it.
Thank you Rebecca & Zach for writing it.
I’m working in Chapter 7 about “all things testing” and am on page 184, where you are discussing testing calculations and make use of the define_calculation DSL.
The issue I have come across is that this doesn’t seem to be compatible with the AshPhoenix module - included as an extension at the top of the Music domain module.
It seems to expect there to be an :action key on the definition in the domain.
It errors at line 93 in ash_phoenix.ex:
defp add_form_interface(interface, dsl_state, resource, resource? \\ false) do
name = :"form_to_#{interface.name}"
action =
if resource? do
Ash.Resource.Info.action(dsl_state, interface.action || interface.name)
else
--->>>> Ash.Resource.Info.action(resource, interface.action || interface.name)
end
Clearly, the definition of the calculation in the domain doesn’t need/know the action.
Please let me know if I can help further with this.
Thanks again
Martin