-
Type: Task
-
Resolution: Cannot Reproduce
-
Priority: Major - P3
-
Affects Version/s: None
-
Component/s: None
-
None
The operation: #<Moped::Protocol::Command @length=80 @request_id=205 @response_to=0 @op_code=2004 @flags=[] @full_collection_name="path_development.$cmd" @skip=0 @limit=-1 @selector={:getlasterror=>1, :w=>1} @fields=nil> failed with error 66: "After applying the update to the document {_id: ObjectId('55a930b9417274900a190000') , ...}, the (immutable) field '_id' was found to have been altered to _id: null" See https://github.com/mongodb/mongo/blob/master/docs/errors.md for details about this error.
admin_input
>> admin_input
=> #<Pathify::AdminInput _id: 55a93451417274900a210000, data: {"station_origin_id"=>"55a7ba0941727435b2000000", "station_destination_id"=>"55a7d7874172744859000000", "local_departure_date"=>"16/07/2015", "local_arrival_date"=>"16/07/2015", "local_departure_time"=>"12:15", "local_arrival_time"=>"19:23", "train_provider_id"=>""}, type: "train_reservation", traveller_id: BSON::ObjectId('5596855f417274e9c8000000'), admin_user_id: nil>
train_reservation
>> subject => #<Pathify::TrainReservation _id: 55a93451417274900a220000, utc_departure_date: 2015-07-16 11:15:00 UTC, utc_arrival_date: 2015-07-16 17:23:00 UTC, local_departure_date: 2015-07-16 12:15:00 UTC, local_arrival_date: 2015-07-16 19:23:00 UTC, duration: {:year=>0, :month=>0, :week=>0, :day=>0, :hour=>6, :minute=>8, :second=>0, :diff=>"06:08:00"}, seconds_duration: 22080, traveller_id: BSON::ObjectId('5596855f417274e9c8000000'), station_origin_id: BSON::ObjectId('55a7ba0941727435b2000000'), station_destination_id: BSON::ObjectId('55a7d7874172744859000000'), train_provider_id: nil>
line where it breaks
admin_input.train_reservations = [subject]
or
admin_input.train_reservations << subject