Answer by atlascoder for Rails :dependent => :destroy VS :dependent =>...
Actually the main difference is that any callbacks will not be invoked when :delete_all was used. But when used :destroy the callbacks stack (:after_destroy, :after_commit ...) will be...
View ArticleAnswer by Manish Shrivastava for Rails :dependent => :destroy VS :dependent...
See destroy deletes its associated elements where delete_all can delete multiple data from self table as DELETE * FROM table where field = 'xyz':Dependent possible options:Controls what happens to the...
View ArticleAnswer by John Topley for Rails :dependent => :destroy VS :dependent =>...
On a Rails' model association you can specify the :dependent option, which can take one of the following three forms::destroy/:destroy_all The associated objects are destroyed alongside this object by...
View ArticleAnswer by shingara for Rails :dependent => :destroy VS :dependent => :delete_all
The difference is with the callback.The :delete_all is made directly in your application and deletes by SQL :DELETE * FROM users where compagny_id = XXXXWith the :destroy, there is an instantiation of...
View ArticleRails :dependent => :destroy VS :dependent => :delete_all
In rails guides it's described like this:Objects will be in addition destroyed if they’re associated with :dependent => :destroy, and deleted if they’re associated with :dependent =>...
View Article
More Pages to Explore .....