mongo_mapper_versioned 0.2.3 → 0.2.4
Sign up to get free protection for your applications and to get access to all the features.
@@ -3,9 +3,15 @@ module MongoMapper
|
|
3
3
|
module Versioned
|
4
4
|
class Version
|
5
5
|
|
6
|
+
|
7
|
+
|
8
|
+
# ---------------------------------------------------------------------
|
6
9
|
include MongoMapper::Document
|
7
10
|
include Comparable
|
8
11
|
|
12
|
+
|
13
|
+
|
14
|
+
# ---------------------------------------------------------------------
|
9
15
|
# stores id of versioned document
|
10
16
|
key :versioned_id, ObjectId
|
11
17
|
|
@@ -14,7 +20,15 @@ module MongoMapper
|
|
14
20
|
|
15
21
|
# stores versioned attributes
|
16
22
|
key :data, Hash
|
23
|
+
|
24
|
+
|
25
|
+
|
26
|
+
# ---------------------------------------------------------------------
|
27
|
+
ensure_index [[:version_number, 1], [:versioned_id, 1]]
|
17
28
|
|
29
|
+
|
30
|
+
|
31
|
+
# ---------------------------------------------------------------------
|
18
32
|
# allow comparison
|
19
33
|
def <=>(other)
|
20
34
|
version_number <=> other.version_number
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mongo_mapper_versioned
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 31
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 2
|
9
|
-
-
|
10
|
-
version: 0.2.
|
9
|
+
- 4
|
10
|
+
version: 0.2.4
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Tomas Celizna
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2011-02-
|
18
|
+
date: 2011-02-20 00:00:00 +01:00
|
19
19
|
default_executable:
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|