On Sunday, April 10, 2016 at 12:21:42 PM UTC-7, Wesley Key wrote:
>
> I've been trying to research how to run an after_delete hook on cascade 
> delete with no luck.
>
> Are model hooks called on a cascade delete?
>

For that type of thing, it's best to use a database trigger. It may be 
possible to use model hooks if you only want to handle the deletes using a 
model API, but that limits you to only deleting rows via Model#destroy, or 
running the risk of inconsistent state.  In general it is best to have the 
database enforce consistency whenever possible.

Thanks,
Jeremy

-- 
You received this message because you are subscribed to the Google Groups 
"sequel-talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/sequel-talk.
For more options, visit https://groups.google.com/d/optout.

Reply via email to