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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 4666a1722e54deeb04862e948d64a161294f8376
4
- data.tar.gz: 04cfa71232a1a30d37ae0039ce708770d759eb59
3
+ metadata.gz: 0c6398ef400e2c11f7ea34f7c76ce5c32e4ff55e
4
+ data.tar.gz: 12993bd8c34dc4da790a610ea75451a89fb2dd04
5
5
  SHA512:
6
- metadata.gz: 15c47e301dc73e00ecac9a4092435041c9211bb225c77451369642a5f5773e6f8246092056bdb410d245ba40b1187d158fda389cf15cddd03560a3c6a114a204
7
- data.tar.gz: 088be5f1c6371508955bd3fb91b9664dcd7e74f4317b7b39602084e2a86282d9df6f77860cbda13e266b01bd1878ccd9fcf2cdf9eded7a1508924db67d9c6504
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
- db['soft_deleted_records'].insert(row)
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
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-28 00:00:00.000000000 Z
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