mongoid_paranoia 0.2.0 → 0.2.1

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: deac1371595d42d09d10aab1039561adb1190da7
4
- data.tar.gz: b29cbcc347078b464c218646b58780a8f50bb3bf
3
+ metadata.gz: 2edfadf14fc3b166efd190f331c5e86a75de4c20
4
+ data.tar.gz: 988223f244d3537c149c7d354163031fbb658c5e
5
5
  SHA512:
6
- metadata.gz: 6b0dc3130837783326de78218f63c4f807c2c09cf45de8f52038dec7eb12667488362db029954a789c79377f9266d4ff78d247ed76097ba4348389b28354218e
7
- data.tar.gz: 45a65478ef3edab1351c4834b52afed11c26f117721ad5c444b94439ebe159cdb6fad6a31cf31254b2eaaaaeef80be352541b26f4525caf161605d95dc75afe6
6
+ metadata.gz: 37fb1381901fc197f18f79cbbfea5f8db627c94f8d9fa84da71a234878a69c4c9d6eec6e1ac6486f9fac4c59343556fc66ef186f0da5e92700396929b28534b7
7
+ data.tar.gz: f69bd91ff7eeabf02d205608a4081967ec02f703b4b807489b251898d44786739023263f44a6c55e07e638d01abe0aafb9386b98da5af67cd44581065662671e
@@ -98,7 +98,7 @@ module Mongoid
98
98
  def remove_with_paranoia(options = {})
99
99
  cascade!
100
100
  time = self.deleted_at = Time.now
101
- update("$set" => { paranoid_field => time })
101
+ _paranoia_update("$set" => { paranoid_field => time })
102
102
  @destroyed = true
103
103
  true
104
104
  end
@@ -145,7 +145,7 @@ module Mongoid
145
145
  # @since 1.0.0
146
146
  def restore(opts = {})
147
147
  run_callbacks(:restore) do
148
- update("$unset" => { paranoid_field => true })
148
+ _paranoia_update("$unset" => { paranoid_field => true })
149
149
  attributes.delete("deleted_at")
150
150
  @destroyed = false
151
151
  restore_relations if opts[:recursive]
@@ -193,10 +193,10 @@ module Mongoid
193
193
  embedded? ? "#{atomic_position}.#{field}" : field
194
194
  end
195
195
 
196
- # Update value in the collection.
196
+ # Update value in the collection (compatibility layer for Mongoid 4/5).
197
197
  #
198
198
  # @return [ Object ] Update result.
199
- def update(value)
199
+ def _paranoia_update(value)
200
200
  query = paranoid_collection.find(atomic_selector)
201
201
  if Mongoid::Compatibility::Version.mongoid5?
202
202
  query.update_one(value)
@@ -1,5 +1,5 @@
1
1
  module Mongoid
2
2
  module Paranoia
3
- VERSION = '0.2.0'
3
+ VERSION = '0.2.1'
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mongoid_paranoia
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Durran Jordan
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2015-09-22 00:00:00.000000000 Z
12
+ date: 2015-09-28 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: mongoid