diff --git a/core/server/models/offer.js b/core/server/models/offer.js new file mode 100644 index 0000000000..6a50eee12f --- /dev/null +++ b/core/server/models/offer.js @@ -0,0 +1,13 @@ +const ghostBookshelf = require('./base'); + +const Offer = ghostBookshelf.Model.extend({ + tableName: 'offers', + + product() { + return this.belongsTo('Product', 'product_id', 'id'); + } +}); + +module.exports = { + Offer: ghostBookshelf.model('Offer', Offer) +};