<commit_before>var mwcKernel = require('mwc_kernel');

var MWC = mwcKernel({
  'hostUrl': 'http://vvv.msk0.ru/',
  'mongoUrl': 'mongodb://localhost/mwc_dev',
  'secret': 'LalalaDai3Ryblya',
  'disableCsrf':true
});

MWC.extendModel('Cats', function (mongoose, config) {
  var CatsSchema = new mongoose.Schema({
    'nickname': String,
    'owner': mongoose.Schema.Types.ObjectId
  });

  CatsSchema.index({
    nickname: 1,
    owner: 1
  });

  CatsSchema.statics.getForUser = function (user, parameters, callback) {
    if (user && user._id) {
      //var query = this.find({'owner': user._id});
      var query = this.find();
      //todo - parameters

      query.exec(callback);
    } else {
      callback(null);
    }
  };
  CatsSchema.statics.canCreate = function (user) {
    return (user) ? true : false;
  };
  CatsSchema.methods.canRead = function (user) {
    return (user._id === this.owner);
  };
  CatsSchema.methods.canWrite = function (user) {
    return (user._id === this.owner);
  };
  return mongoose.model('cats', CatsSchema);
});

MWC.usePlugin(require('./../index.js'));
MWC.extendRoutes(function (core) {
  core.app.get('/', function (request, response) {
    if (request.user) {
      response.sendfile(__dirname + '/api.html');
    } else {
      response.sendfile(__dirname + '/index.html');
    }
  });
});

MWC.start();<commit_msg>[fix] - proper plugin name<commit_after>var mwcKernel = require('kabam-kernel');

var MWC = mwcKernel({
  'hostUrl': 'http://vvv.msk0.ru/',
  'mongoUrl': 'mongodb://localhost/mwc_dev',
  'secret': 'LalalaDai3Ryblya',
  'disableCsrf':true
});

MWC.extendModel('Cats', function (kabam) {
  var CatSchema = new kabam.mongoose.Schema({
    'nickname': String,
    'owner': kabam.mongoose.Schema.Types.ObjectId
  });

  CatSchema.index({
    nickname: 1,
    owner: 1
  });

  CatSchema.statics.getForUser = function (user, parameters, callback) {
    if (user && user._id) {
      //var query = this.find({'owner': user._id});
      var query = this.find();
      //todo - parameters

      query.exec(callback);
    } else {
      callback(null);
    }
  };
  CatSchema.statics.canCreate = function (user) {
    return (user) ? true : false;
  };
  CatSchema.methods.canRead = function (user) {
    return (user._id === this.owner);
  };
  CatSchema.methods.canWrite = function (user) {
    return (user._id === this.owner);
  };
  return kabam.mongoConnection.model('cat', CatSchema);
});

MWC.usePlugin(require('./../index.js'));
MWC.extendRoutes(function (core) {
  core.app.get('/', function (request, response) {
    if (request.user) {
      response.sendfile(__dirname + '/api.html');
    } else {
      response.sendfile(__dirname + '/index.html');
    }
  });
});

MWC.start();
{'fraction_non_alphanumeric': 0.18287795992714026, 'fraction_numerical': 0.0029143897996357013, 'mean_word_length': 3.1923664122137403, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5129818', 'n_tokens_mistral': 980, 'n_tokens_neox': 969, 'n_words': 175}