MartinVolerich
Define_calculation incompatibility
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
Most Liked
zachdaniel
I’ve fixed this and released a new version of ash_phoenix v2.1.16. You can mix deps.update ash_phoenix to get the fix.
Popular in Questions
Other popular topics
Latest Ash Threads
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #deployment
- #library
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #channels
- #elixirconf
- #exunit
- #discussion
- #code-sync
- #javascript
- #podcasts
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #elixir-ls
- #phoenix_html
- #iex
- #blog-post
- #graphql
- #genstage
- #ai
- #websockets
- #supervisor
- #elixirconf-us
- #advent-of-code
- #distillery
- #processes
- #forms
- #api
- #metaprogramming
- #hex
- #security










