Hi, I have two models - Post and Category. Post belongsTo Category, therefore there is a category_id column in my posts table and this column is NULL if the Post does not belong to any Category or contains id of the Category it belongs to. What I am trying to do is to make the column NULL if I delete the Category but I haven't found any way how to do it. Can anyone please help?
I tried to create another relationship - Category hasMany Posts with dependent set to true but that deletes the posts and I only want to delete the category and null the association. Of course I can do it manually in beforeDelete callback but I thought there might be a better and easier way because I don't want to keep track of all the models that belongsTo Category. Thanks for any help. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~----------~----~----~----~------~----~------~--~---
