adonis-lucid-polymorphic icon indicating copy to clipboard operation
adonis-lucid-polymorphic copied to clipboard

should it be 'module.exports=Comment' instead of 'module.exports=Video' ?

Open ericsonweah opened this issue 6 years ago • 0 comments

// 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

ericsonweah avatar Feb 15 '19 13:02 ericsonweah