나는 많은 것을 통해 애써야 만합니다. here과 같은 관계를 맺고 있습니다. 그러나 내 관련 모델은 자체 조인을 통해 참조 모델과 동일합니다.많은 사람들이 배트맨에서 자조를하고 있습니다
이class Article extends Batman.Model
@hasMany 'citations'
@hasMany 'usages', name: 'Citation', foreignKey: 'referenced_article_id'
@accessor 'referenced_articles', ->
@get('citations').mappedTo('referenced_article')
class Citation extends Batman.Model
@belongsTo 'article'
@belongsTo 'referenced_article', name: 'Article'
불행하게도, my_article.get('referenced_articles')
를 호출하면 오류를 준다 : 나는 이것을 시도했다. 어떤 아이디어? 당신의 연결이 usages
라는 이름 때문에
웹 사이트 (http://batmanjs.org/download.html)에서 batman/master를 다운로드 할 수 있지만 몇 가지 중요한 변경 사항이 있습니다 (https://github.com/batmanjs/batman/issues/1106 참조) . 핀치에 앱 정의 바로 앞에 ^^ 줄을 추가하면됩니다. 그걸 마스터에 고정시키기 전에 내가 고쳐 놓은 방법. – rmosolgo