`to_key` method on ActiveModel and ActiveRecord returns an key that can
be can be used to query the db to find that object. We should follow
that API, and not return an ObjectId object.
This fixes an annoying bug when using Mongoid + Devise, where devise use
the to_key method to serialize the user in the session.