Mark For Destruction
Last updated
Was this helpful?
Last updated
Was this helpful?
Do you have some complicated logic or criteria for deleting associated records? may come in handy.
Let's say we have users who author articles. We want to delete some of the user's articles based on some criteria -- those articles that have odd id
s.
We've marked our articles for destruction and confirmed as much with the method. Now, to go through with the destruction, we just have to save the parent record -- the user.
Note: the parent record must have autosave: true
declared on the association.