Skip to content

Testing a model save/patch with ember-cli-mirage with a hasMany but no belongsTo

Notifications You must be signed in to change notification settings

jrburke/mirage-hasmany

Repository files navigation

Mirage-hasmany

A test of an ember-cli-mirage setup where the library model hasMany books, but the book model does not belongTo library.

The issue is how to save a new book such that it is seen as attached to the library.

Setup

Assumes ember-cli 2.8.x.

npm install && bower install
ember serve

To try out the issue, go to:

http://localhost:4200/counties/library/1/book/new

and try to add a book.

When clicking the Add book button, the book is seen temporarily on the page, but once the library.save() method finishes, it disappears.

This seems to happen because the PATCH for the library does not update the books relationship to account for the new book.

Issue tracking

miragejs/ember-cli-mirage#904

About

Testing a model save/patch with ember-cli-mirage with a hasMany but no belongsTo

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published