Rails ruby-china 中,Model Notification::Base 中 store_in :notifications 是什么意思

hlcfan · 2012年04月05日 · 最后由 hlcfan 回复于 2012年04月05日 · 3289 次阅读

大家好, ruby-china 中,Notification::Base 中 store_in :notifications 是什么意思? 谢谢。

#1 楼 @ywencn 你好,我查到这个了,但是英语差啊,还请你解释。

Mongoid by default stores documents in a collection that is the pluralized form of the class name. documents 默认存放在以类的复数形式的 collection 中。

#3 楼 @zhenning 那既然默认了,为什么还要指定 store_in:notifications ?

#4 楼 @hlcfan 没看过 mongoid 的东西,我猜是因为 notification 在 base 的命令空间下吧。

#5 楼 @zhenning i'll figure it out,thx.man

因为 Notification::Base 默认应该是 notification_bases 之类的,不太美观

#7 楼 @Rei ok.gotcha.muchas gracias.

需要 登录 后方可回复, 如果你还没有账号请 注册新账号