Skip to content

Instantly share code, notes, and snippets.

@nicholasf
Created May 18, 2014 01:16
Show Gist options
  • Save nicholasf/2ee45632a093ebbf262d to your computer and use it in GitHub Desktop.
Save nicholasf/2ee45632a093ebbf262d to your computer and use it in GitHub Desktop.
handler.finders.push('person', function(args){ //db specific logic to find person });
handler.finders.push('house', function(args){ //db specific logic to find house });

Person.find( { id: n, with: ['House'] }); //this would forward to the person finder above unless ...
 
handler.finders.push('person_with_house', function(args) {
    console.log(args);
});

> { id: n }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment