Created
February 24, 2015 18:24
-
-
Save pon/a0ab2650e31d9b89a553 to your computer and use it in GitHub Desktop.
People/City Bookshelf Models
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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