The difference between dependent: :destroy and :delete_all
Adding “dependent: :destroy” to “has_many” is a good choice but can sometimes slow down your code. Switching to “dependent: :delete_all” will decrease the number of SQL queries by skipping validations and callbacks => https://www.youtube.com/watch?v=Gsw2gPbT1so
Post a comment