radar/paranoia — pull request #103 by alfa-jpn (2014-01-20 17:13:31+00:00)
Title: Improved behavior of restore.

Hello.

I'm afraid my expressions may be rude or hard to read, because I'm not so good at English.

When use restore!(:recursive => true), all associations are restored.
Even if model who destroyed before parent is destroyed, restored.
For example,

``` ruby
class ParentModel < ActiveRecord::Base
has_many :child_models, dependent: :destroy
end

class ChildModel < ActiveRecord::Base
acts_as_paranoid
belongs_to :parent_model
end
```
When call restore!, The changes as follows.
``` ruby
parent = ParentModel.new
first = parent.child_models.create
second = parent.child_models.create

first.destroy
# first => destroyed

parent.destroy
# parent => destroyed, second => destroyed

parent.restore!(:recursive => true)
# parent => restored, second => restored, first => restored

```

This pr improved behavior of restore.
If child model has a dependent_delete column(*modifiable), dependent_delete has a info of 'deleted by dependence'. restore method see it.

``` sh
rails g add_dependent_delete_to_child_models dependent_delete:boolean
```

dependent_delete column is modifiable.

``` ruby
acts_as_paranoid dependent_column: dependent_destroyed
```

When call restore!, The changes as follows.
``` ruby
parent = ParentModel.new
first = parent.child_models.create
second = parent.child_models.create

first.destroy
# first => destroyed

parent.destroy
# parent => destroyed, second => destroyed

parent.restore!(:recursive => true)
# parent => restored, second => restored

```

In addition, do i have to be send pullrequest for branch of rails4.