diff --git a/core/server/models/product.js b/core/server/models/product.js index 68cab87f44..84639e72e6 100644 --- a/core/server/models/product.js +++ b/core/server/models/product.js @@ -25,6 +25,14 @@ const Product = ghostBookshelf.Model.extend({ } }, + monthlyPrice() { + return this.belongsTo('StripePrice', 'monthly_price_id', 'id'); + }, + + yearlyPrice() { + return this.belongsTo('StripePrice', 'yearly_price_id', 'id'); + }, + stripeProducts() { return this.hasMany('StripeProduct', 'product_id', 'id'); },