Grape实体和单表继承

时间:2016-10-10 09:36:48

标签: inheritance grape grape-entity

假设我有基类“Attachment< ActiveRecord :: Base”和2个子类“Attachment :: Video< Attachment”,“Attachment :: Image< Attachment”。

present Attachment.all, with: API::Entities::AttachmentEntity

但我想为不同的子类使用不同的实体。 附件::视频应与API :: Entities :: AttachmentEntity :: Video等一起出现

葡萄可以吗?

0 个答案:

没有答案