Using Ember data rev 12 (Last commit: 38117ba (2013-05-10 17:49:04 -0700))
Type in console:
obj = {
"lists" : [{ "id": 1, "name" : "ListOne", "user_ids" : [1,2] },{ "id": 2, "name" : "ListTwo", "user_ids" : [3,4] },],
"users": [
{ "id": 1, "username": "user1", "list": 1 },
{ "id": 2, "username": "user2", "list": 1 },
{ "id": 3, "username": "user3", "list": 2 },
{ "id": 4, "username": "user4", "list": 2 },
]
}
;
DS.get('defaultStore').load(App.List, obj);
var id = 42; // ???
var store = DS.get("defaultStore");
var adapter = store.adapterForType(App.List);
adapter.didFindMany(store, App.List, obj);
console.log(App.List.find(1).serialize());
console.log(App.List.find(2).serialize());
console.log(App.Users.find(1).serialize());
console.log(App.Users.find(2).serialize());
console.log(App.Users.find(3).serialize());
console.log(App.Users.find(4).serialize());
>> Object {name: "ListOne"}
Object {name: "ListTwo"}
Object {username: "user1", user_id: 42}
Object {username: "user2", user_id: 42}
Object {username: "user3", user_id: 42}
Object {username: "user4", user_id: 42}