Skip to content

Instantly share code, notes, and snippets.

@kcarriedo
Created August 15, 2010 14:38
Show Gist options
  • Select an option

  • Save kcarriedo/525555 to your computer and use it in GitHub Desktop.

Select an option

Save kcarriedo/525555 to your computer and use it in GitHub Desktop.
Todos.TaskJSONProxy = SC.Object.create(
normalize_task_data: function(data) {
result = new Array();
if (data.length == undefined)
{
array_name = 'data.task';
eval(array_name).guid = eval(array_name).id;
result.push(eval(array_name));
}
else
{
for(var i=0; i<data.length; i++) {
array_name = 'data[i].task';
eval(array_name).guid = eval(array_name).id;
result.push(eval(array_name));
}
}
return result;
}
}) ;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment