cloudfoundry/cloud_controller_ng — pull request #126 by animeshsingh (2013-11-19 23:24:41+00:00)
Title: Deleting a space recursively should soft delete apps instead of destroying  them.

Deleting a space recursively should soft delete apps instead of destroying them.
Fixes 57414538.
We thought about various approaches, and decided to use the approach where we override the default destroy method of app.rb to do soft delete. Now since we are retaining the apps after Space is deleted, we are making the space_id column to be nullable, and ading checks in model to ensure that it is nullified when space is deleted. Stack is also nullified for apps as we want to only soft delete apps rather than destroying them when Stack is deleted. I have also added tests in space, apps and stacks specs to ensure everything is tested.