Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
P
paranoia
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ikcrm_common
paranoia
Commits
fc161377
Commit
fc161377
authored
Mar 08, 2017
by
edwardmp
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add README
parent
51f95410
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
1 deletions
+7
-1
README.md
+7
-0
test/paranoia_test.rb
+0
-1
No files found.
README.md
View file @
fc161377
...
...
@@ -189,6 +189,13 @@ Client.restore(id, :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.
#### About indexes:
...
...
test/paranoia_test.rb
View file @
fc161377
...
...
@@ -1283,7 +1283,6 @@ class NotParanoidModelWithBelongsAndAssocationNotSoftDestroyedValidator < NotPar
validates
:parent_model
,
association_not_soft_destroyed:
true
end
class
FlaggedModel
<
PlainModel
acts_as_paranoid
:flag_column
=>
:is_deleted
end
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment