views:

20

answers:

1

In my Sinatra app, I'm using a MongoDB with Grid to store book covers on Heroku. I want to be able to associate these with the books in my ActiveRecord-driven primary database. Currently, I'm downloading the image from Google Books, storing it in the MongoDB, and storing the BSON::ObjectID object into the database as a string.

When I go to retrieve the image, however, grid won't accept this string as a way to get the file.

Is there a better way for me to store this information or a better way for me to associate data between the two databases?

A: 

A friend helped me with this one: it was a YAML string, so

YAML::load

on the string being stored in the database did the trick.

Kevin Griffin