[eluser]Tim Stackhouse[/eluser]
Good to know, and thanks for making such an awesome library, but I even tried setting the cascade_on_delete option to false and it still was letting me delete from my roles table when I had an ON DELETE RESTRICT on the users_roles table. I ended up just earlier this afternoon doing a check if there are related users to a role before allowing deletion of the role.
In terms of DB layout, and the cascade, with the exception of many-many relationships shouldn't the FK reside in the belongs_to model? That is:
My current project has a basic structure like this:
User
|->Symposium
| |->Session
| | |->Presentation
| | |->Presentation
| | |->Presentation
| |->Session
| | |->Presentation
| | :
| :
|->Symposium
:
The way I have it laid out, symposium has a user_id field, session has a symposium_id field and presentation has a session_id field. That layout wouldn't need any nulls, and from a data integrity standpoint, if i blew away an entry in User and it DIDN'T cascade, that would corrupt my data.
I'm probably being terribly redundant and restating something that quality programmers recite as mantra, bu t does that sound logical?