sql - Rails When using dependent destroy and dependent nullify -


i want know relation dependent destroy , dependent nullify on rails , relation sql.

thanks

example: table users , table cars

user has many cars car belongs users

in table car have user_id on each row

if set dependent destroy when defining relationship in users, when delete user, cars having user_id deleted also

if set nullify, cars remain, user_id column set null (it pointless have value there because user id deleted)

hope helps


Comments

Popular posts from this blog

ios - UICollectionView Self Sizing Cells with Auto Layout -

node.js - ldapjs - write after end error -

DOM Manipulation in Wordpress (and elsewhere) using php -