怎样才能在铁路2.3.5 mongoid.yml配置? [英] How can i generate mongoid.yml config in Rail 2.3.5?

查看:209
本文介绍了怎样才能在铁路2.3.5 mongoid.yml配置?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

正如标题所说,我怎么能生成铁2.3.5默认mongoid.yml配置文件?

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

我尝试使用'rails产生mongoid:config'命令,但它只是产生一个新的应用程序

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

还有,我想用的has_many在mongoid没有在同一个领域中嵌入相关的模型。我想他们是在不同的领域,并通过* _id列有关。这可能吗?

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?

推荐答案

您不能。 MongoID的主分支仅仅是Rails 3的兼容。如果你想使用mongoID使用Rails 2.3.5,您需要使用MongoID的1.0.x的分支。

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.

在这个版本中,没有mongoid发生器。您需要定义您自己的初始化与MongoDB的连接。

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

这篇关于怎样才能在铁路2.3.5 mongoid.yml配置?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆