var semver = require('semver');

module.exports = function (compound, Migration) {
    if (Migration) {
        /*
         * Return the highest _version_ in db, not the Migration instance.
         */
        Migration.maxVersion = function (done) {
            var maxVersion = null;

            Migration.all({where: {active: true}},function (err, migrations) {
                if (err) { return done(err); }
                    var versionNames   = migrations.map(function (m) { return m.version; });
                    maxVersion = semver.maxSatisfying(versionNames, ''); // Get highest version.
                    done(null, maxVersion);
            });
        };


    }
};

@@ -311,16 +311,17 @@
 ll(%7B
+ 
 where: %7B
 acti
@@ -316,16 +316,17 @@
 where: %7B
+ 
 active: 
@@ -333,11 +333,13 @@
 true
+ 
 %7D%7D,
+ 
 func
@@ -671,18 +671,16 @@
      %7D;%0A
-%0A%0A
     %7D%0A%7D;

Fix format on model.