-
-
Save evanchaney/b8028e9fe5dc3766ba4e to your computer and use it in GitHub Desktop.
Log: reproducing conflicting-mods issue in Mongoid using Mongo 2.4.2; modifications missing after reload
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading development environment (Rails 3.2.13) | |
2.0.0-p0 :001 > t = Train.create! | |
MOPED: 127.0.0.1:27017 COMMAND database=admin command={:ismaster=>1} (1.2758ms) | |
MOPED: 127.0.0.1:27017 INSERT database=mongoid_conflicting_mods_development collection=trains documents=[{"_id"=>"51745e04e3defeea70000001"}] flags=[] | |
COMMAND database=mongoid_conflicting_mods_development command={:getlasterror=>1, :safe=>true} (25.0471ms) | |
=> #<Train _id: 51745e04e3defeea70000001, > | |
2.0.0-p0 :002 > t.update_attributes(cars_attributes: [{capacity: 2}]) | |
MOPED: 127.0.0.1:27017 UPDATE database=mongoid_conflicting_mods_development collection=trains selector={"_id"=>"51745e04e3defeea70000001"} update={"$set"=>{"seats"=>[{"_id"=>"51745e08e3defeea70000002"}, {"_id"=>"51745e08e3defeea70000003"}]}, "$pushAll"=>{""=>[{"_id"=>"51745e08e3defeea70000004", "seats"=>[{"_id"=>"51745e08e3defeea70000002"}, {"_id"=>"51745e08e3defeea70000003"}]}]}} flags=[] | |
COMMAND database=mongoid_conflicting_mods_development command={:getlasterror=>1, :safe=>true} (0.9749ms) | |
=> true | |
2.0.0-p0 :003 > t.cars | |
=> [#<Car _id: 51745e08e3defeea70000004, >] | |
2.0.0-p0 :004 > t.cars.first.seats | |
=> [#<Seat _id: 51745e08e3defeea70000002, >, #<Seat _id: 51745e08e3defeea70000003, >] | |
2.0.0-p0 :005 > t.reload | |
MOPED: 127.0.0.1:27017 QUERY database=mongoid_conflicting_mods_development collection=trains selector={:_id=>"51745e04e3defeea70000001"} flags=[] limit=-1 skip=0 batch_size=nil fields=nil (0.6881ms) | |
=> #<Train _id: 51745e04e3defeea70000001, : [{"_id"=>"51745e08e3defeea70000004", "seats"=>[{"_id"=>"51745e08e3defeea70000002"}, {"_id"=>"51745e08e3defeea70000003"}]}], seats: [{"_id"=>"51745e08e3defeea70000002"}, {"_id"=>"51745e08e3defeea70000003"}]> | |
2.0.0-p0 :006 > t.cars | |
=> [] | |
2.0.0-p0 :007 > |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment