Yeg*_*sky 7 inheritance ruby-grape grape-entity
假设我有基类"Attachment <ActiveRecord :: Base"和2个子类"Attachment :: Video <Attachment","Attachment :: Image <Attachment".
present Attachment.all, with: API::Entities::AttachmentEntity
Run Code Online (Sandbox Code Playgroud)
但我想为不同的子类使用不同的实体.附件::视频应与API :: Entities :: AttachmentEntity :: Video等一起出现
葡萄有可能吗?