mongoo 0.4.7 → 0.4.8

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.4.7
1
+ 0.4.8
@@ -175,6 +175,7 @@ module Mongoo
175
175
  unless ret.is_a?(BSON::ObjectId)
176
176
  raise InsertError, "not an object: #{ret.inspect}"
177
177
  end
178
+ mongohash.delete(:_id)
178
179
  set("_id", ret)
179
180
  @persisted = true
180
181
  set_persisted_mongohash(mongohash)
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{mongoo}
8
- s.version = "0.4.7"
8
+ s.version = "0.4.8"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Ben Myles"]
@@ -413,5 +413,19 @@ class TestMongoo < Test::Unit::TestCase
413
413
  assert_equal "Ben Myles", p.name
414
414
  assert_equal ["skydiving", "coding", "swimming"], p.interests
415
415
  end
416
+
417
+ should "be just one _id key after insert" do
418
+ p = Person.new(name: "Ben")
419
+ p.insert!
420
+ assert p.mongohash.has_key?('_id')
421
+ assert !p.mongohash.has_key?(:_id)
422
+ p.name = "Ben Myles"
423
+ p.update!
424
+ assert p.mongohash.has_key?('_id')
425
+ assert !p.mongohash.has_key?(:_id)
426
+ p = Person.find_one(p.id)
427
+ assert p.mongohash.has_key?('_id')
428
+ assert !p.mongohash.has_key?(:_id)
429
+ end
416
430
  end
417
431
 
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: mongoo
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.4.7
5
+ version: 0.4.8
6
6
  platform: ruby
7
7
  authors:
8
8
  - Ben Myles
@@ -189,7 +189,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
189
189
  requirements:
190
190
  - - ">="
191
191
  - !ruby/object:Gem::Version
192
- hash: 2470312361995980630
192
+ hash: 3583778272833589372
193
193
  segments:
194
194
  - 0
195
195
  version: "0"