Quantcast
Channel: Rails :dependent => :destroy VS :dependent => :delete_all - Stack Overflow
Browsing latest articles
Browse All 5 View Live

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 Article



Answer 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 Article

Answer 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 Article

Answer 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 Article

Rails :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

Browsing latest articles
Browse All 5 View Live




Latest Images