ash icon indicating copy to clipboard operation
ash copied to clipboard

Complex & Multi step actions guide

Open zachdaniel opened this issue 10 months ago • 4 comments

This guide should talk about:

  • changes
  • preparations
  • how to think about using hooks in both cases
  • real-world examples where you might use hooks
  • considerations between things like "before action", "before transaction" etc.
  • some examples of manage_relationship
  • reactor as an alternative way of doing complex workflows (I or someone else can write this part)

It does not have to explain these things in complete depth, we can link to other relevant guides.

zachdaniel avatar Jan 31 '25 16:01 zachdaniel

I can commit some time to this in the next few weeks. Expect questions on the forum or discord as I work through it since I'm not an expert. :)

chazwatkins avatar Jan 31 '25 16:01 chazwatkins

@chazwatkins I don't have the practical knowledge to get anywhere on this as a whole myself. But I'd be happy to lend a hand if you find any chunks that can be reasonably delegated.

mkschell avatar Feb 04 '25 15:02 mkschell

@chazwatkins I don't have the practical knowledge to get anywhere on this as a whole myself. But I'd be happy to lend a hand if you find any chunks that can be reasonably delegated.

@mkschell Sure. I've been busy this month and won't get around to this for another few weeks. If you want to dive in and get started on something, go for it. Happy to collaborate on it as time permits.

chazwatkins avatar Feb 28 '25 19:02 chazwatkins

Putting some notes here on ideas for the guide

  • changes
    • Creating a parent record and then a child record in one action
  • preparations
  • how to think about using hooks in both cases
  • real-world examples where you might use hooks
    • Maybe use an after_action hook to create the child record
    • Maybe use an external API to fetch data in a before_action hook
    • Not sure of a scenario to use before/after transaction yet
  • considerations between things like "before action", "before transaction" etc.
    • Section explaining the uses of each, when they should be considered, and when they should be avoided
  • some examples of manage_relationship
    • multi-level manage_relationship
    • use of cascade_update and cascade_delete - Also, when should these be used vs postgres references on_delete
  • reactor as an alternative way of doing complex workflows (I or someone else can write this part)
    • This will come last as I have zero experience with Reactor. But, I'll study up on it when I get to it.

chazwatkins avatar Mar 30 '25 12:03 chazwatkins