mm_soft_deleted 0.0.4 → 0.0.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/mongo_mapper/soft_deleted.rb +4 -5
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0c6398ef400e2c11f7ea34f7c76ce5c32e4ff55e
|
4
|
+
data.tar.gz: 12993bd8c34dc4da790a610ea75451a89fb2dd04
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8ebf0beac94c8d7d345baad2dbeeeac4ecc8cdf681b3c38a50bb125f9d30fc6fd9c3c35595b7c73680dfa239e55fcdf87ac15f8d913c536109c17b5654b90103
|
7
|
+
data.tar.gz: fe72f6affb4f092d95f153128eca7b522b27ef2f84cda78ced45d5f2ba8022d5a239a9fa5706fd653a61f169289f101e715a6a5c7d2b12e3c0f054c0c143452e
|
@@ -23,11 +23,7 @@ module MongoMapper::SoftDeleted
|
|
23
23
|
|
24
24
|
mod.after_destroy do
|
25
25
|
return true unless MongoMapper::SoftDeleted.enabled?
|
26
|
-
return true if @__soft_deleted_destroy_run
|
27
|
-
|
28
|
-
@__soft_deleted_destroy_run = true
|
29
26
|
soft_delete_destroy(self)
|
30
|
-
|
31
27
|
true
|
32
28
|
end
|
33
29
|
end
|
@@ -41,7 +37,10 @@ module MongoMapper::SoftDeleted
|
|
41
37
|
row[:_deleted_at] = Time.now
|
42
38
|
row[:_original_type] = obj.attributes[:_type]
|
43
39
|
|
44
|
-
|
40
|
+
begin
|
41
|
+
db['soft_deleted_records'].insert(row)
|
42
|
+
rescue Mongo::OperationFailure
|
43
|
+
end
|
45
44
|
end
|
46
45
|
|
47
46
|
def soft_delete_restore!
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mm_soft_deleted
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Scott Taylor
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-10-
|
11
|
+
date: 2016-10-30 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: Soft delete records with mongo mapper
|
14
14
|
email: scott@railsnewbie.com
|