ember-codemods / ember-qunit-codemod

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Error: You should not call `create` on a model

Turbo87 opened this issue · comments

Error: You should not call create on a model. Instead, call store.createRecord with the attributes you would like to set.

I'm seeing the above error after converting some of our model tests.

Awesome. We need to fix the fixtures and update the output.

We need to fix the fixtures and update the output.

to what exactly?

For this.subject calls in moduleForModel we need to emit:

let subject = this.owner.lookup('service:store').createRecord(options);