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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d392b2da40b54482e91d89731eed624efb083c76
|
4
|
+
data.tar.gz: d6685e1bb4bbc37bd5fbc8057afc953ec6215203
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
|
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.
|
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-
|
11
|
+
date: 2018-01-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|