radar/paranoia — Issue #20: Restore doesn't restore dependent children
Author: cj
Created: 2012-02-17 20:40:00+00:00
State: open

Using `.restore!` doesn't restore the dependent children.

```
1.9.3-p0 :008 > owner = Owner.unscoped.first
DEBUG - Owner Load (0.7ms) SELECT `owners`.* FROM `owners` LIMIT 1
=> #
1.9.3-p0 :009 > owner.restore!
DEBUG - (10.4ms) BEGIN
DEBUG - (0.8ms) UPDATE `owners` SET `deleted_at` = NULL, `updated_at` = '2012-02-17 14:36:33' WHERE `owners`.`id` = 2
DEBUG - (3.0ms) COMMIT
=> true
```

Also if you call `.restore!` on a just destroyed record you get an error:

```
1.9.3-p0 :001 > owner = Owner.first
DEBUG - Owner Load (0.2ms) SELECT `owners`.* FROM `owners` WHERE `owners`.`deleted_at` IS NULL LIMIT 1
=> #
1.9.3-p0 :002 > owner.destroy
DEBUG - Address Load (3.7ms) SELECT `addresses`.* FROM `addresses` WHERE `addresses`.`deleted_at` IS NULL AND `addresses`.`location_id` = 2 AND `addresses`.`location_type` = 'Owner' LIMIT 1
DEBUG - (0.1ms) BEGIN
DEBUG - (2.0ms) UPDATE `addresses` SET `deleted_at` = '2012-02-17 14:30:26', `updated_at` = '2012-02-17 14:30:26' WHERE `addresses`.`id` = 1
DEBUG - (1.7ms) COMMIT
DEBUG - (0.1ms) BEGIN
DEBUG - (3.4ms) UPDATE `owners` SET `deleted_at` = '2012-02-17 14:30:26', `updated_at` = '2012-02-17 14:30:26' WHERE `owners`.`id` = 2
DEBUG - (0.5ms) COMMIT
=> #
1.9.3-p0 :003 > owner.restore!
RuntimeError: can't modify frozen Hash
```