mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-03-11 02:12:21 -05:00
Added relation between Member & OfferRedemption
refs https://github.com/TryGhost/Team/issues/1135 This will allow us to fetch the OfferRedemptions for a Member so that we can display them on the Member details page.
This commit is contained in:
parent
8709da36e9
commit
03d4561a5f
1 changed files with 5 additions and 0 deletions
|
@ -94,6 +94,11 @@ const Member = ghostBookshelf.Model.extend({
|
|||
});
|
||||
},
|
||||
|
||||
offerRedemptions() {
|
||||
return this.hasMany('OfferRedemption', 'member_id', 'id')
|
||||
.query('orderBy', 'created_at', 'DESC');
|
||||
},
|
||||
|
||||
labels: function labels() {
|
||||
return this.belongsToMany('Label', 'members_labels', 'member_id', 'label_id')
|
||||
.withPivot('sort_order')
|
||||
|
|
Loading…
Add table
Reference in a new issue