mongoid-paranoia 1.0.0 → 1.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +7 -1
- data/lib/mongoid/core_ext/builders/nested_attributes/many.rb +2 -1
- data/lib/mongoid/paranoia/version.rb +1 -1
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fc24c0ced97e7874f1ede67769d583404566c9d1
|
4
|
+
data.tar.gz: 0de95f0da7e4629b174c6cd913f14d0253fd878c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4d8c7d26685e95732fd05d271448842213729afc0b5f7fc239be52272a84a8cc8dff643652365f27df8ad14af28b7e4264843fa374ca28b8cdf811e1a4e15b28
|
7
|
+
data.tar.gz: 022abe0146a850af533e7233e8861ab3957603927e09e48754e7b42cd68db60e9dc05624ba43c2d3b59367f867bd0c4afeade4a4625191eb8f91ce3adc039ee9
|
data/README.md
CHANGED
@@ -3,7 +3,13 @@
|
|
3
3
|
**Important:** This gem is an extraction of [Mongoid::Paranoia](http://mongoid.org/en/mongoid/v3/extras.html#paranoia) from the official [mongoid](http://mongoid.org) gem.
|
4
4
|
Since Mongoid::Paranoia was removed in the `4.0.0` release of Mongoid, this gem re-enables the functionality of paranoid documents.
|
5
5
|
|
6
|
-
**Please submit only bug and security fixes**. Neither I will accept new features nor changes to existing APIs.
|
6
|
+
**Please submit only bug and security fixes**. Neither I will accept new features nor changes to existing APIs.
|
7
|
+
|
8
|
+
**Attention:** There are two similarly named gems out there: `mongoid-paranoia` and `mongoid_paranoia`
|
9
|
+
|
10
|
+
* `mongoid-paranoia`'s (this one) goal is to stay API compatible, which comes at the cost of (breaking) API changes to be rejected. If you're updating a Mongoid 3.x app to Mongoid 4.0 and you depend on `Mongoid::Paranoia` this gem is recommended for continuity.
|
11
|
+
|
12
|
+
* However if your code is working and you want new features, for example a `*_restore` callback, you should head over to @simi's `mongoid_paranoia` gem at https://github.com/simi/mongoid_paranoia. He is doing a great job there and is willing to accept your PRs ;)
|
7
13
|
|
8
14
|
---
|
9
15
|
|
@@ -4,6 +4,7 @@ module Mongoid
|
|
4
4
|
module Builders
|
5
5
|
module NestedAttributes
|
6
6
|
class Many < NestedBuilder
|
7
|
+
alias_method :original_destroy, :destroy
|
7
8
|
|
8
9
|
# Destroy the child document, needs to do some checking for embedded
|
9
10
|
# relations and delay the destroy in case parent validation fails.
|
@@ -22,7 +23,7 @@ module Mongoid
|
|
22
23
|
if doc.paranoid?
|
23
24
|
destroy_document(relation, doc)
|
24
25
|
else
|
25
|
-
|
26
|
+
original_destroy(parent, relation, doc)
|
26
27
|
end
|
27
28
|
end
|
28
29
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mongoid-paranoia
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mario Uher
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2015-08-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -310,8 +310,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
310
310
|
version: '0'
|
311
311
|
requirements: []
|
312
312
|
rubyforge_project:
|
313
|
-
rubygems_version: 2.
|
313
|
+
rubygems_version: 2.4.8
|
314
314
|
signing_key:
|
315
315
|
specification_version: 4
|
316
316
|
summary: Extraction of mongoid-paranoia into its own gem.
|
317
317
|
test_files: []
|
318
|
+
has_rdoc:
|