And in example, where I work we have an after_update on a model that is a Transaction and it checks if the updated attribute is status and if it is then recalculate the PromissoryNote attached to that Transaction (is a simplified example), without using that hook where can you put that logic?
Normally we work on controller and put it inside an interaction (github.com/AaronLasseigne/active_i...) or service object. The solution some times is more verbose but the developer regain control. When you are developing a prototype can be a good idea use "callback and friends" to go faster but when things get complicated we try to avoid it. This rule is not a strict rule but a suggestion to avoid "callback hell"
Yes :-)
And in example, where I work we have an
after_update
on a model that is a Transaction and it checks if the updated attribute isstatus
and if it is then recalculate the PromissoryNote attached to that Transaction (is a simplified example), without using that hook where can you put that logic?Normally we work on controller and put it inside an interaction (github.com/AaronLasseigne/active_i...) or service object. The solution some times is more verbose but the developer regain control. When you are developing a prototype can be a good idea use "callback and friends" to go faster but when things get complicated we try to avoid it. This rule is not a strict rule but a suggestion to avoid "callback hell"
Thanks man! I'd seriously take this in consideration, we might be in callback hell already 😅