/**
 * Module dependencies.
 */
const Score     = require('./score');
const mongoose  = require('mongoose');
const Schema    = mongoose.Schema;

// create a schema
const gameSchema = new Schema({
  started_at: Date,
  ended_at: Date,
  teams: [Schema.Types.ObjectId],
  score: [Score.schema]
});

gameSchema.methods.start = function start(completion) {
  if (!this.started_at) {
    // game is already started
    this.started_at = new Date();
  }

gameSchema.prototype.complete = function finishGame(completion) {
  if (ended_at) {
    // game is already completed
    return;
  }

  ended_at = new Date();
  completion();
}

// make this available to our users in our Node applications
module.exports = Game;

@@ -446,37 +446,52 @@
  %7D%0A%0A
-gameSchema.prototype.complete
+  completion();%0A%7D%0A%0AgameSchema.methods.finish
  = f
@@ -504,20 +504,16 @@
 n finish
-Game
 (complet
@@ -525,24 +525,30 @@
 %7B%0A  if (
+!this.
 ended_at
 ) %7B%0A    
@@ -535,24 +535,43 @@
 his.ended_at
+ && this.started_at
 ) %7B%0A    // g
@@ -603,23 +603,13 @@
     
-return;%0A  %7D%0A%0A  
+this.
 ende
@@ -627,16 +627,21 @@
 Date();%0A
+  %7D%0A%0A
   comple

Add finish function