collectiveidea / awesome_nested_set

An awesome replacement for acts_as_nested_set and better_nested_set.
MIT License
2.39k stars 492 forks source link

Destroy in reverse order to respect foreign keys #478

Closed kaspernj closed 1 year ago

kaspernj commented 1 year ago

Otherwise a foreign key error ala "Mysql2::Error: Cannot delete or update a parent row: a foreign key constraint fails" can occur if foreign keys have been added.