我正在尝试使多态关联起作用,但到目前为止还没有运气。基本上我希望这首歌属于播放列表和专辑
App.Playlist = App.Trackable.extend
App.Album = App.Trackable.extend
App.Trackable = DS.Model.extend
tracks: DS.hasMany 'track'
App.Track = DS.Model.extend
title: DS.attr 'string'
trackable: DS.belongsTo('trackable',
polymorphic: true)
但后来我收到以下错误
Uncaught TypeError: Cannot call method 'extend' of undefined