adonis-lucid-polymorphic
adonis-lucid-polymorphic copied to clipboard
should it be 'module.exports=Comment' instead of 'module.exports=Video' ?
// App/Model/Comment 'use strict'
const Model = use('Lucid')
class Comment extends Model { static get traits () { return ['@provider:Morphable'] }
commentable () { return this.morphTo([ 'App/Models/Post', 'App/Models/Video' ], 'id', 'id', 'commentable_id', 'commentable_type') } }
module.exports = Video