rails : rabl gem, customize type conversion
I use Mongo DB with Mongoid but same thing appear with Mongo Mapper.

I get the following output :

    {
      :a_doc => {
        :id => BSON::ObjectId('4f8d37521e5945f14a0000a3')
      }
    }

I would like to keep this clean syntaxe :

    object @a_doc
    attributes :id

Instead to do write :

    object @a_doc
    attributes :string_id => :id

So at some point in rabl, I would like to catch type to convert it.
Any idea how to do that ?
rails : rabl gem, customize type conversion
===

I use Mongo DB with Mongoid but same thing appear with Mongo Mapper.

I get the following output :

    {
      :a_doc => {
        :id => BSON::ObjectId('4f8d37521e5945f14a0000a3')
      }
    }

I would like to keep this clean syntaxe :

    object @a_doc
    attributes :id

Instead to do write :

    object @a_doc
    attributes :string_id => :id

So at some point in rabl, I would like to catch type to convert it.
Any idea how to do that ?