[eluser]theshiftexchange[/eluser]
Hi everyone,
How do I use active records to delete multiple records across two tables with a one to many relationship in the following scenario?
I have table 1 with a list of "ads". Each ad has a unique "ad_ID" and a "date".
I have table 2 with a list of stuff for the ad, with it having many items for one "ad_ID".
So if I decide to delete all "ads" from table 1 older than a certain date, I need it to delete any corresponding items from table 2 with all the "ad_ID" that just got deleted.
I'm thinking I need some sort of join function? Do joins allow you to delete data across tables?