activerecord and mongo / mongo-mapper bridge

25 views
Skip to first unread message

holden

unread,
Feb 13, 2010, 3:40:02 PM2/13/10
to MongoMapper
I have a project which I have used Active Record and which I'd like to
add some new features using MongoDB. Rather than re-invent the wheel
and re-write my entire site, how can I integrate 2 models together,
one which use MongoMapper and the other ActiveRecord (postgres).

I've found a few posts indicated that others have done this
successfully, but no real mention of how.

For example, I have an STI Mongo model(s) of Places which I want to
relate to an existing ActiveRecord model of Locations... ie Cities.
and a User model based on Authlogic... how can I use them in concert?
I'd be grateful for a pointer or two in the right direction.

Thanks,

John Nunemaker

unread,
Feb 13, 2010, 3:56:18 PM2/13/10
to mongo...@googlegroups.com
Just add key :location_id, Integer and make methods like location that do Location.find(location_id) and such.


--
You received this message because you are subscribed to the Google
Groups "MongoMapper" group.
For more options, visit this group at
http://groups.google.com/group/mongomapper?hl=en?hl=en

holden

unread,
Feb 14, 2010, 6:40:37 PM2/14/10
to MongoMapper
So simple, and it works perfectly, thanks!

On Feb 13, 9:56 pm, John Nunemaker <nunema...@gmail.com> wrote:
> Just add key :location_id, Integer and make methods like location that do
> Location.find(location_id) and such.
>

Reply all
Reply to author
Forward
0 new messages