Last active
August 29, 2015 14:00
-
-
Save tauren/11130847 to your computer and use it in GitHub Desktop.
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
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 | |
} | |
} | |
}; |
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
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' | |
} | |
} | |
}; |
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
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' | |
} | |
} | |
}; |
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
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