How can i generate mongoid.yml config in Rail 2.3.

2019-07-08 04:23发布

As the title says, how can i generate the default mongoid.yml config file on Rail 2.3.5?

I try to use the ´rails generate mongoid:config´ command but it just generates a new app.

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

1条回答
来,给爷笑一个
2楼-- · 2019-07-08 04:43

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.

查看更多
登录 后发表回答