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

hlcfan · April 05, 2012 · Last by hlcfan replied at April 05, 2012 · 3290 hits

大家好, 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.

You need to Sign in before reply, if you don't have an account, please Sign up first.