text: var requireOption = require('../common').requireOption;
  
  /**
   * Get the rented cars that are currently at a client and put the cars on res.tpl.cars
   * @param objectRepository
   * @returns {Function}
   */
  module.exports = function (objectRepository) {
  
      var carModel = requireOption(objectRepository, 'carModel');
  
      return function (req, res, next) {
  
          carModel.find({ state : "occupied"}, function (err, result) {
              if(err){
                  return next(new Error('Error getting cars'));
              }
  
              res.tpl.cars = result;
              return next();
          });
      }
  
  };