Skip to content

Instantly share code, notes, and snippets.

@pon
Created February 24, 2015 18:24
Show Gist options
  • Save pon/a0ab2650e31d9b89a553 to your computer and use it in GitHub Desktop.
Save pon/a0ab2650e31d9b89a553 to your computer and use it in GitHub Desktop.
People/City Bookshelf Models
var City = bookshelf.Model.extend({
tableName: 'city'
});
var User = bookshelf.Model.extend({
tableName: 'people',
city: function() {
return this.hasOne(City);
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment