mongomapper_plugins 0.0.3 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
@@ -1,19 +1,14 @@
|
|
1
1
|
module MongoMapper
|
2
2
|
module Plugins
|
3
3
|
module VersionedUpdate
|
4
|
-
def self.configure(mod)
|
5
|
-
mod.class_eval {
|
6
|
-
key :_version, Integer, :default => 1
|
7
|
-
}
|
8
|
-
end
|
9
|
-
|
10
4
|
module ClassMethods
|
11
5
|
def versioned_update
|
12
|
-
|
6
|
+
include MongoMapper::Plugins::VersionedUpdate::OverriddenMethods
|
7
|
+
key :_version, Integer, :default => 1
|
13
8
|
end
|
14
9
|
end
|
15
10
|
|
16
|
-
module
|
11
|
+
module OverriddenMethods
|
17
12
|
private
|
18
13
|
def update(options={})
|
19
14
|
version = self._version
|