{"action":"created","issue":{"url":"https://api.github.com/repos/samselikoff/ember-cli-mirage/issues/943","repository_url":"https://api.github.com/repos/samselikoff/ember-cli-mirage","labels_url":"https://api.github.com/repos/samselikoff/ember-cli-mirage/issues/943/labels{/name}","comments_url":"https://api.github.com/repos/samselikoff/ember-cli-mirage/issues/943/comments","events_url":"https://api.github.com/repos/samselikoff/ember-cli-mirage/issues/943/events","html_url":"https://github.com/samselikoff/ember-cli-mirage/issues/943","id":189470295,"number":943,"title":"Maximum call stack exceeded","user":{"login":"simonihmig","id":1325249,"avatar_url":"https://avatars3.githubusercontent.com/u/1325249?v=3","gravatar_id":"","url":"https://api.github.com/users/simonihmig","html_url":"https://github.com/simonihmig","followers_url":"https://api.github.com/users/simonihmig/followers","following_url":"https://api.github.com/users/simonihmig/following{/other_user}","gists_url":"https://api.github.com/users/simonihmig/gists{/gist_id}","starred_url":"https://api.github.com/users/simonihmig/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/simonihmig/subscriptions","organizations_url":"https://api.github.com/users/simonihmig/orgs","repos_url":"https://api.github.com/users/simonihmig/repos","events_url":"https://api.github.com/users/simonihmig/events{/privacy}","received_events_url":"https://api.github.com/users/simonihmig/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":19,"created_at":"2016-11-15T18:31:10Z","updated_at":"2017-03-31T16:22:17Z","closed_at":"2017-03-31T16:22:17Z","body":"I have the following model relationship defined, including their inverse counterpart:\r\n\r\n**product** -- hasMany --> **product-association** -- hasMany --> **product**\r\n\r\nThis is how the database is seeded in one of my tests:\r\n\r\n      let associatedProducts = server.createList('product', 4);\r\n      let association = server.create('product-association', {\r\n        associatedObjects: associatedProducts\r\n      });\r\n      let product = server.create('product', {\r\n        associations: [association]\r\n      });\r\n\r\nOn the last `create` statement for `product` I get an \"Maximum call stack exceeded\" exception. Judging from the call stack the `_setupRelationships` method is called with infinite recursion. At some point it is called again for the `product` itself that is just to be created and which started this chain.\r\n\r\nInterestingly this happened after upgrading from 0.2.0-beta.8 to 0.2.4, so it was working very well with the prerelease version!"},"comment":{"url":"https://api.github.com/repos/samselikoff/ember-cli-mirage/issues/comments/290759840","html_url":"https://github.com/samselikoff/ember-cli-mirage/issues/943#issuecomment-290759840","issue_url":"https://api.github.com/repos/samselikoff/ember-cli-mirage/issues/943","id":290759840,"user":{"login":"samselikoff","id":2922250,"avatar_url":"https://avatars2.githubusercontent.com/u/2922250?v=3","gravatar_id":"","url":"https://api.github.com/users/samselikoff","html_url":"https://github.com/samselikoff","followers_url":"https://api.github.com/users/samselikoff/followers","following_url":"https://api.github.com/users/samselikoff/following{/other_user}","gists_url":"https://api.github.com/users/samselikoff/gists{/gist_id}","starred_url":"https://api.github.com/users/samselikoff/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/samselikoff/subscriptions","organizations_url":"https://api.github.com/users/samselikoff/orgs","repos_url":"https://api.github.com/users/samselikoff/repos","events_url":"https://api.github.com/users/samselikoff/events{/privacy}","received_events_url":"https://api.github.com/users/samselikoff/received_events","type":"User","site_admin":false},"created_at":"2017-03-31T16:22:17Z","updated_at":"2017-03-31T16:22:17Z","body":"With 0.3 recursive relationships now work. The only feature missing from Mirage's ORM is polymorphic relationship support, which I'll be working on soon.\r\n\r\n@mariogintili let me know if you run into any issues."}}
{"actor":{"display_login":"samselikoff"}}