{"comment":{"created_at":"2011-10-19T14:48:34Z","body":"Yep that makes sense. I think what I'm talking about is the case above - both documents are unpersisted. It seems like doing something like this:\r\n\r\n```\r\nMovie.new :ratings => [Rating.new]\r\n```\r\n\r\nIs causing /something/ to be persisted immediately, presumably the Rating object (which is where the ```TypeError``` comes from).","updated_at":"2011-10-19T14:48:34Z","url":"https://api.github.com/repos/mongoid/mongoid/issues/comments/2456659","id":2456659,"user":{"avatar_url":"https://secure.gravatar.com/avatar/64bf8422796992b66c379f725c67389f?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","gravatar_id":"64bf8422796992b66c379f725c67389f","url":"https://api.github.com/users/bensymonds","id":52046,"login":"bensymonds"}},"action":"created","issue":{"number":1358,"created_at":"2011-10-19T13:28:45Z","pull_request":{"diff_url":null,"patch_url":null,"html_url":null},"body":"```ruby\r\nclass Movie\r\n include Mongoid::Document\r\n has_and_belongs_to_many :ratings, :inverse_of => nil\r\nend\r\n\r\nclass Rating\r\n include Mongoid::Document\r\nend\r\n\r\nMovie.new :ratings => [Rating.new]\r\n=> TypeError: keys must be strings or symbols\r\n```\r\n\r\nMongoid is correctly determining there is no inverse foreign key field (so is nil), but still tries to do the update to the Rating anyway (i.e. tries to do something like ```update(nil => movie._id)```, hence the ```TypeError```.","comments":4,"title":"HABTM :inverse_of => nil broken in 2.3.2","updated_at":"2011-10-19T14:48:34Z","url":"https://api.github.com/repos/mongoid/mongoid/issues/1358","id":1993845,"assignee":null,"milestone":null,"closed_at":null,"user":{"avatar_url":"https://secure.gravatar.com/avatar/64bf8422796992b66c379f725c67389f?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","gravatar_id":"64bf8422796992b66c379f725c67389f","url":"https://api.github.com/users/bensymonds","id":52046,"login":"bensymonds"},"html_url":"https://github.com/mongoid/mongoid/issues/1358","labels":[{"name":"bug","url":"https://api.github.com/repos/mongoid/mongoid/labels/bug","color":"e10c02"},{"name":"confirmed","url":"https://api.github.com/repos/mongoid/mongoid/labels/confirmed","color":"e10c02"}],"state":"open"},"legacy":{"issue_id":1993845,"comment_id":2456659}}