开发者

is single table inheritance (STI) available when using polymorphism in mongoid?

When using STI and polymorphism in ActiveRecord, the following is needed to ensure that

:dependent => :destroy

will work properly:

开发者_JAVA百科
def attachable_type=(sType)
    super(sType.to_s.classify.constantize.base_class.to_s)
end

Has anyone been using STI and polymorphism successfully with Mongoid?

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜