mongoid_versioned_atomic 0.0.2 → 0.0.3

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: d83eb64a3ce02734d1d23bb0a68774ac009088a1
4
- data.tar.gz: 12d3ddf6e8b9c379191b86d7505c354aca79e0fc
3
+ metadata.gz: d392b2da40b54482e91d89731eed624efb083c76
4
+ data.tar.gz: d6685e1bb4bbc37bd5fbc8057afc953ec6215203
5
5
  SHA512:
6
- metadata.gz: f2e65e4bc80c43b1b3683a9390cbc52a30f9f60fa793c875c63ee2b425da4f0d33cc670619b8f9fc37b17fa99d48ad0434bbb46e68aba73e55931c79bd7fa079
7
- data.tar.gz: 7b8dbd095df5136ccb0ee7ab7abae9905fd961edd2ffe35ae2957a321e7c5f3668d01bc5b62533c448c0ce524a5d874b90ad55f261ae712e4e64ffcbb0093ffd
6
+ metadata.gz: a8970d3797693063c263d6a2f0318e8c3a3054d7c50e03c7b3735f58dde28024c112c4379b22c89ed1b94c4e3825ef2636befbce90be115325ee7edbee002e1f
7
+ data.tar.gz: 4db81d6277285e3ea2111c6628ef39791ddb1da9fe3913d8395086db7954fc3d4d3a94b59bb59ce9264711b4c7cf50aab0b67b92cc2b300f8adb1e391ff1e029
@@ -174,6 +174,14 @@ module MongoidVersionedAtomic
174
174
  raise DbUnchanged if !self.modified_count == 1
175
175
  end
176
176
 
177
+ ## overrides the save method on the model.
178
+ ## calls versioned_create if it is a new record
179
+ ## otherwise calls versioned_update.
180
+ def save(options = {})
181
+ self.new_record? ? self.versioned_create(options) : self.versioned_update(options)
182
+ end
183
+
184
+
177
185
  ## @param query[Hash] : optional query hash.
178
186
  ## @param log[Boolean] : defaults to false, set true if you want to print out the final command sent to mongo.
179
187
 
@@ -1,3 +1,3 @@
1
1
  module MongoidVersionedAtomic
2
- VERSION = "0.0.2"
2
+ VERSION = "0.0.3"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mongoid_versioned_atomic
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - greatmanta111
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-01-19 00:00:00.000000000 Z
11
+ date: 2018-01-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake