Skip to content

Instantly share code, notes, and snippets.

@sudara
Created June 24, 2009 21:41
Show Gist options
  • Save sudara/135534 to your computer and use it in GitHub Desktop.
Save sudara/135534 to your computer and use it in GitHub Desktop.
// Grab all users
q = SC.Query.create({recordType:Listenapp.User});
var users = Listenapp.alonetone.findAll(q);
// Ok, now only get users starting with S
q.set('conditions':'name STARTS_WITH "A"); //does not work actually, get syntax error
// If I hack the data_source
if(SC.instanceOf(fetchKey, SC.Query) && fetchKey.conditions === undefined) return [];
// and do the following
q= SC.Query.create({recordType: Listenapp.User, 'conditions':'name BEGINS_WITH "A"'});
var users = Listenapp.alonetone.findAll(q);
// then i get the result i'm looking for
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment