var createJob = require('./createJob');

module.exports = function (sails) {
  return {
    defaults: {cron: {}},

    initialize: function (cb) {
      var config = sails.config.cron;
      var tasks = Object.keys(config);

      tasks.forEach(function (time) {
        return createJob({
          cronTime: time,
          onTick: config[time] instanceof Function ? config[time] : config[time].onTick,
          onComplete: config[time].onComplete,
          timezone: config[time].timezone
        });
      });

      cb();
    }
  };
};

@@ -81,16 +81,31 @@
 eturn %7B%0A
+    jobs: %7B%7D,%0A%0A
     defa
@@ -232,17 +232,16 @@
 onfig);%0A
-%0A
       ta
@@ -278,22 +278,33 @@
         
-return
+this.jobs%5Btime%5D =
  createJ
@@ -531,16 +531,27 @@
 %0A      %7D
+.bind(this)
 );%0A%0A    

Implement returning created jobs