Browse Source

Add loadRelationShips for rating_calculation.

pull/6/head
t123yh 7 years ago
parent
commit
b7c1d6e585
  1. 5
      models/rating_calculation.js

5
models/rating_calculation.js

@ -22,6 +22,7 @@
let Sequelize = require('sequelize');
let db = syzoj.db;
const User = syzoj.model('user');
const Contest = syzoj.model('contest');
let model = db.define('rating_calculation', {
id: { type: Sequelize.INTEGER, primaryKey: true, autoIncrement: true },
@ -53,6 +54,10 @@ class RatingCalculation extends Model {
return newItem;
}
async loadRelationShips() {
this.contest = await Contest.fromID(this.contest_id);
}
getModel() { return model; }
async delete() {

Loading…
Cancel
Save