0.02
No commit activity in last 3 years
No release in over 3 years
There's a lot of open issues
Recursively delete all dependent model associations without an N + 1
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Runtime

>= 3.2.3
= 0.5.0
 Project Readme

##Recurse Delete

When you call Record.destroy in Rails, it instantiates all its associations (that are :dependent => :destroy) and calls destroy on each. This is an N + 1, you can delete all the associated records without the N + 1 if you set the association as :dependent => :delete_all. However, this will not delete all the sub associations. This is the compromise recurse-delete solves. You can read more about it here: http://programming-perils.com/436/rails-prevent-dependent-destroy-n-plus-ones/

Add to GemFile: gem 'recurse-delete'

Usage: Record.recurse_delete