mongo_mapper_versioned 0.1.8 → 0.1.9
Sign up to get free protection for your applications and to get access to all the features.
@@ -7,7 +7,7 @@ module MongoMapper
|
|
7
7
|
configuration = { :ignored_keys => %w(_id version_number created_at updated_at creator_id updater_id) }
|
8
8
|
configuration[:ignored_keys].concat(options[:ignored_keys]).uniq if options.key?(:ignored_keys)
|
9
9
|
|
10
|
-
key :version_number, Integer, :
|
10
|
+
key :version_number, Integer, :index => true
|
11
11
|
many :versions, :class => MongoMapper::Plugins::Versioned::Version, :foreign_key => :versioned_id, :dependent => :destroy, :order => :version_number.asc
|
12
12
|
|
13
13
|
after_create :create_version, :if => :should_create_initial_version?
|
@@ -24,7 +24,7 @@ class VersionedTest < ActiveSupport::TestCase
|
|
24
24
|
@doc = VersionedDoc.new
|
25
25
|
end
|
26
26
|
should "be on version 0" do
|
27
|
-
|
27
|
+
assert_nil @doc.version_number
|
28
28
|
end
|
29
29
|
should "have 0 versions" do
|
30
30
|
assert_equal 0, @doc.versions.count
|
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: 9
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 1
|
9
|
-
-
|
10
|
-
version: 0.1.
|
9
|
+
- 9
|
10
|
+
version: 0.1.9
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Tomas Celizna
|