From d9e8c8f42a8bfa3168ca13a0d58ad2bf589e547a Mon Sep 17 00:00:00 2001 From: Tyler Renelle Date: Wed, 2 May 2012 19:44:12 -0400 Subject: [PATCH] Closer to correct use of todoIds --- src/app/index.coffee | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/app/index.coffee b/src/app/index.coffee index 505325dc1d..c1d89cb93f 100644 --- a/src/app/index.coffee +++ b/src/app/index.coffee @@ -23,12 +23,12 @@ get '/', (page, model) -> getRoom = (page, model, userId) -> model.subscribe "users.#{userId}", (err, user) -> model.ref '_user', user - todoIds = model.at '_user.todos.todoIds' + todoIds = user.at 'todoIds' # The refList supports array methods, but it stores the todo values # on an object by id. The todos are stored on the object 'todos', # and their order is stored in an array of ids at '_group.todoIds' - model.refList '_todoList', "_user.todos", todoIds + model.refList '_todoList', '_user.todos', '_user.todoIds' # Add some default todos if this is a new group. Items inserted into # a refList will automatically get an 'id' property if not specified