Allvalidationstilltakesplace,butthe`result`inany`after_action`callbacksattachedtothatactionwillsimplybetherecordthatwasreadfromthedatabaseinitially.Forcreates,the`result`willbe`nil`,andyouwillbeexpectedtohandlethechangesetinanafter_actioncallbackandreturnaninstanceoftherecord.ThisisagoodwaytopreventAshfromissuinganunnecessaryupdatetotherecord,e.gupdatingthe`updated_at`oftherecordwhenanactionactuallyonlyinvolvesmodifyingrelatingrecords.Youcouldthenhandlethechangesetautomatically.Forexample:# in the action```elixiraction:special_createdomanual?truechangeMyApp.DoCreateend# The changedefmoduleMyApp.DoCreatedouseAsh.Resource.Changedefchange(changeset,_,_)doAsh.Changeset.after_action(changeset,fnchangeset,_result-># result will be `nil`, because this is a manual actionresult=do_something_that_creates_the_record(changeset){:ok,result}end)endend```
for manual reads
Manualreadactionswillsimplybehandedtheashqueryandthedatalayerquery.Ifyousimplywanttocustomize/interceptthequerybeforeitissenttothedatalayerthenuse`modify_query`instead.Usingtheminconjunctioncanhelpensurethatcalculationsandaggregatesareallcorrect.Forexample,youcouldmodifythequerytoalter/replacethewhereclause/filterusing`modify_query`whichwillaffectwhichrecordscalculationsarereturnedfor.Thenyoucancustomizehowitisrunusing`manual`.```elixir# in the resourceactionsdoread:action_namedomanualMyApp.ManualRead# or `{MyApp.ManualRead, ...opts}`endend# the implementationdefmoduleMyApp.ManualReaddouseAsh.Resource.ManualReaddefread(ash_query,ecto_query,_opts,_context)do...{:ok,query_results}|{:error,error}endend```