Skip to content

Instantly share code, notes, and snippets.

@tauren
Last active August 29, 2015 14:00
Show Gist options
  • Save tauren/11130847 to your computer and use it in GitHub Desktop.
Save tauren/11130847 to your computer and use it in GitHub Desktop.
module.exports = {
attributes: {
// The participation that submitted this entry
participation: {
model: 'participation',
required: true
},
// TODO: Do we need this, can't we get it from participation.contest?
contest: {
model: 'Contest',
required: true
},
// Rounds that include this entry
rounds: {
collection: 'Round',
via: 'entries'
},
// Groups that include this entry
groups: {
collection: 'EntryGroup',
via: 'entries',
dominant: true
}
}
};
module.exports = {
attributes: {
// The participant that owns this group
participation: {
model: 'participation',
required: true
},
// The round that this group is part of
round: {
model: 'round',
required: true
},
// All of the other entries that are included in this group
entries: {
collection: 'Entry',
via: 'groups'
}
}
};
module.exports = {
attributes: {
// The user who is participating in a contest
user: {
model: 'User',
required: true
},
// The contest this user is participating in
contest: {
model: 'Contest',
required: true
},
// This user's entry into the contest
entry: {
model: 'Entry'
},
// This user's groups for this contest, one per round, contains other entries they get to see and vote on
groups: {
collection: 'EntryGroup',
via: 'participation'
}
}
};
module.exports = {
attributes: {
// The contest this round is part of
contest: {
model: 'Contest',
required: true
},
// One group per participant/entry in this round
groups: {
collection: 'EntryGroup',
via: 'round'
},
// All of the entries in this round
entries: {
collection: 'Entry',
via: 'rounds',
dominant: true
}
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment