views:

369

answers:

1

As the title says, how can i generate the default mongoid.yml config file on Rail 2.3.5? I try to use te ´rails generate mongoid:config´ command but it just generates a new app.

And also, i would like to use has_many in mongoid without embeding the associated model in the same field. I would like them to be in seperate fields and associated through a *_id "column". Is that possible?

Thank you, Micke.

+2  A: 

You can't. The master branch of MongoID is only Rails 3 compatible. If you want use mongoID with Rails 2.3.5, you need using the 1.0.x branch of MongoID.

In this version, there are no mongoid generator. You need define you own initializer to connect with MongoDB.

shingara
oh, do you think i should upgrade to 3 then? Is it stable enough. Just started on the application so it shouldnt be to hard to make it Rails 3 compatible. Is it easy to upgrade to the final release of Rails 3 when it arrives?
Micke
if you just started your rails app, go for rails3. I've started my first on in February and also migrated one since and it's getting better every day.
Thomas R. Koll
Rails is a little to beta I think. I start a project with it. But if you are not a experiment Rails developper. I discourage you to try rails 3 beta. It's not really complicated to define you own initializer
shingara