Upgrading

Use this as a reference when upgrading between Mongoid versions.

Upgrading to 2.0.0.beta.16 +

This version requires an upgrade to MongoDB 1.6.0.

Upgrading to 2.0.0.beta.15 +

If you had been using the class variable include_root_in_json for JSON serialization, this will no longer work. You will need to now use the global Mongoid configuration option of the same name in your mongoid.yml if you want to turn it on. (It now defaults to false.)

defaults: &defaults
  include_root_in_json: true
Upgrading to 2.0.0.beta.14 +

The :accessible => false option on fields has been removed in favor of attr_accessible and attr_protected. You will need to change those definitions in your models.

Note that gemcutter is sorting the gems funkily, so when upgrading Mongoid for now you will have to specify the exact version. If you are using bundler then it takes care of this for you. The gems in the way will get yanked soon.

Upgrading to 2.0.0.beta.11 +

The Mongoid.use_object_ids configuration option has been removed and will need to be removed from your mongoid.yml or configuration block.

If you had been using the default String representation of BSON::ObjectID as your ids, you will need to do one of the following options:

a) Tell each one of your models to use Strings as ids like so:

class Person
  include Mongoid::Document
  identity :type => String
end

b) Migrate all your String ids over to ObjectIDs in your database. See This Gist for an example script to do this. (Thanks Kyle Banker)

Upgrading to 2.0.0.beta.10 +

Passenger users who are using smart spawning must now remove their initializers with the reconnect on fork code. Mongoid now handles this for you.

Unicorn users who set preload_app to true must also delete their initializers with the reconnect on fork code. Mongoid now handles this for you as well.

Fork me on GitHub!