Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

removed deprecated ormDriver function from generators code

  • Loading branch information...
commit a784a652bd8144021b8477d1b6a171021832aaec 1 parent 0ac9dbe
@kaero kaero authored
Showing with 5 additions and 17 deletions.
  1. +5 −17 lib/generators.js
View
22 lib/generators.js
@@ -203,7 +203,7 @@ exports.list = function () {
}
var fileExtension = options.coffee ? '.coffee' : '.js';
var Model = model[0].toUpperCase() + model.slice(1);
- var attrs = [], result = [], driver = ormDriver();
+ var attrs = [], result = [];
options.forEach(function (arg) {
var property = arg.split(':')[0],
plainType = arg.split(':')[1],
@@ -331,7 +331,6 @@ exports.list = function () {
* @api public
*/
function crudGenerator(args) {
- var driver = ormDriver();
var model = args[0].split('.').pop();
var parents = args[0].split('.').slice(0, -1);
var models = pluralize(model).toLowerCase();
@@ -351,7 +350,7 @@ exports.list = function () {
var result = modelGenerator.apply(this, Array.prototype.slice.call(arguments));
var fileExtension = options.coffee ? '.coffee' : '.js';
- createFile('app/controllers/' + models + '_controller' + fileExtension, controllerCode(args[0], driver, result));
+ createFile('app/controllers/' + models + '_controller' + fileExtension, controllerCode(args[0], result));
createDir('app/helpers/');
createParents(ns, 'app/helpers/');
@@ -421,7 +420,7 @@ exports.list = function () {
* Get controller code
* @private
*/
- function controllerCode(model, driver, result) {
+ function controllerCode(model, result) {
var fileExtension = options.coffee ? '.coffee' : '.js';
var code;
var parents = model.split('.').slice(0, -1);
@@ -690,10 +689,10 @@ exports.list = function () {
catch(e) {}
});
if (config != null) return config;
- throw new Error( sys.format('Can not find configuration file by path template"%s"', filename) );
+ throw new Error( sys.format('Can not find configuration file by path template "%s"', filename) );
break;
case 'json':
- return JSON.parse(require('fs').readFileSync(filename, 'utf8'));
+ return JSON.parse(fs.readFileSync(filename, 'utf8'));
case 'yml':
return require(filename).shift();
default:
@@ -701,15 +700,4 @@ exports.list = function () {
}
};
- /**
- * Return default ORM driver, based on config/database.json
- * @deprecated
- */
- function ormDriver() {
- if (!ormDriver.config) {
- ormDriver.config = loadConfig(process.cwd() + '/config/database.~').development;
- }
- return ormDriver.config.driver;
- }
-
})();
Please sign in to comment.
Something went wrong with that request. Please try again.