Commit fc161377 by edwardmp

Add README

parent 51f95410
...@@ -189,6 +189,13 @@ Client.restore(id, :recursive => true. :recovery_window => 2.minutes) ...@@ -189,6 +189,13 @@ Client.restore(id, :recursive => true. :recovery_window => 2.minutes)
client.restore(:recursive => true, :recovery_window => 2.minutes) client.restore(:recursive => true, :recovery_window => 2.minutes)
``` ```
Note that by default paranoia will not prevent that a soft destroyed object can't be associated with another object of a different model.
A Rails validator is provided should you require this functionality:
``` ruby
validates :some_assocation, association_not_soft_destroyed: true
```
This validator makes sure that `some_assocation` is not soft destroyed. If the object is soft destroyed the main object is rendered invalid and an validation error is added.
For more information, please look at the tests. For more information, please look at the tests.
#### About indexes: #### About indexes:
......
...@@ -1283,7 +1283,6 @@ class NotParanoidModelWithBelongsAndAssocationNotSoftDestroyedValidator < NotPar ...@@ -1283,7 +1283,6 @@ class NotParanoidModelWithBelongsAndAssocationNotSoftDestroyedValidator < NotPar
validates :parent_model, association_not_soft_destroyed: true validates :parent_model, association_not_soft_destroyed: true
end end
class FlaggedModel < PlainModel class FlaggedModel < PlainModel
acts_as_paranoid :flag_column => :is_deleted acts_as_paranoid :flag_column => :is_deleted
end end
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment