Remote Ruby cover image

Destroy Async, Miss Hannigan, Wisper, and Parcel

Remote Ruby

00:00

Using Foreign Key Relationships in Rails Hastads

Rails has tat option. Now it's dependent destroy a sink. So if the post has many comets, like a comet has a destroy callback,. Then when you sayto destroy a sink,  itwill do is destroy the record and then incue a background job to destroy each dependent like each associated record. Sounds like a dream ight, unless you use foreign key relationships. If i call destroyin on the parent ead the child record has a foreign key to that record, it won't let destroy happen on the parent because it's still being reference. Ye oh no. That's funny, cause i thought the same thing too, of e destroyers. Think

Transcript
Play full episode

The AI-powered Podcast Player

Save insights by tapping your headphones, chat with episodes, discover the best highlights - and more!
App store bannerPlay store banner
Get the app