Im succseefully created polymorphic association between my models. for simplicity lets say I'm using the same models as in documentation example, Video,Image, Comment)
where comment can be associated into Video or Image. as in the example bellow:
const image = await Image.findOne()
const comment = await image.createComment({
content: 'example content',
creatorId : image.id
})
i wonder if it is possible to use findOrCreateComment. currently, I do it in a long way ...
const comment = await Comment.findOne({where:{content:'example content',creatorId:'image.id'}})
if(!comment){
await image.createComment({content:"example content",creatorId:image.id})
}