from 'ember-data/transform'; import Model from 'ember-data/model'; import attr from 'ember-data/attr'; import { hasMany, belongsTo } from 'ember-data/relationships'; 27 proper ember-cli addon
• comment by @bmac in #4156 https://git.io/voHn8 • records in partial state • complexity for caching scenarios • include query params for GET requests • http://jsonapi.org/format/#fetching-includes 36
• use store.queryRecord() when server returns a single record and id is not known beforehand: • GET /current_user • urlForQueryRecord() • store.query() & firstObject for other cases 40
let meta = chaptersRef.meta(); let ids = chaptersRef.ids(); // null if not yet loaded let chapters = chaptersRef.value(); chaptersRef.load().then(function(chapters) { }); chaptersRef.reload().then(...); 49
ajaxOptions() • new public adapter hooks to get properties of request • uses ajax() and ajaxOptions() if present and log a deprecation • plan is to eventually use ember-ajax 52
specific API • book.save({ include: "author" }) • does it include author relationship in request? • should author be included on response? • both? • discussion at PR #4354 59