我使用铁路3.2.2和蒙戈伊德 2.4.6。 为了保持我的收藏规模小,我使用“store_ in” 语句将儿童物品储存在Sepparate收藏中的底座。 我的代码是这样的:
class BaseClass
include Mongoid::Document
end
class ChildClass1 < BaseClass
store_in :child_1
end
class ChildClass2 < BaseClass
store_in :child_2
end
It appears that the objects get randomly stored in or or the other child collection. An object of type Child1 sometimes gets stored in collection Child2. Here is the surprising thing that I see in my logs:
Started POST "/child_class_1" for 127.0.0.1 at 2012-05-22 10:22:51 -0400
Processing by ChildClass1Controller#create as HTML
MONGODB (0ms) myproject_development[ child_2 ].insert....
那是从哪来的?这是蒙戈伊德、铁轨或蒙戈巴的虫子吗?