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?
精彩评论