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

vb.net - Alternative to the T-SQL AS keyword -

php - MySQLi binding parameters in a prepared statement doesn't work unless inserted after "WHERE" -

ios - CFRelease causing crash in iPad application -