不要怂,就是干,撸起袖子干!

Commit ea694812 by Sascha Depold

made jshint happy

1 parent 80a004eb
Showing with 3 additions and 6 deletions
var Utils = require("./utils") var Utils = require("./utils")
, Mixin = require("./associations/mixin") , Mixin = require("./associations/mixin")
, DataTypes = require("./data-types")
, Validator = require("validator") , Validator = require("validator")
module.exports = (function() { module.exports = (function() {
var DAO = function(values, options) { var DAO = function(values, options) {
var self = this
this.attributes = [] this.attributes = []
this.validators = {} // holds validation settings for each attribute this.validators = {} // holds validation settings for each attribute
this.__factory = null // will be set in DAO.build this.__factory = null // will be set in DAO.build
...@@ -32,7 +29,7 @@ module.exports = (function() { ...@@ -32,7 +29,7 @@ module.exports = (function() {
Object.defineProperty(DAO.prototype, 'isDeleted', { Object.defineProperty(DAO.prototype, 'isDeleted', {
get: function() { get: function() {
var result = this.__options.timestamps && this.__options.paranoid var result = this.__options.timestamps && this.__options.paranoid
result = result && this[this.__options.underscored ? 'deleted_at' : 'deletedAt'] != null result = result && this[this.__options.underscored ? 'deleted_at' : 'deletedAt'] !== null
return result return result
} }
......
...@@ -65,11 +65,11 @@ module.exports = (function() { ...@@ -65,11 +65,11 @@ module.exports = (function() {
, self = this , self = this
// add the inserted row id to the instance // add the inserted row id to the instance
if (this.callee && (this.sql.indexOf('INSERT INTO') == 0) && (results.hasOwnProperty('insertId'))) { if (this.callee && (this.sql.indexOf('INSERT INTO') === 0) && (results.hasOwnProperty('insertId'))) {
this.callee[this.callee.__factory.autoIncrementField] = results.insertId this.callee[this.callee.__factory.autoIncrementField] = results.insertId
} }
if (this.sql.indexOf('SELECT') == 0) { if (this.sql.indexOf('SELECT') === 0) {
// transform results into real model instances // transform results into real model instances
// return the first real model instance if options.plain is set (e.g. Model.find) // return the first real model instance if options.plain is set (e.g. Model.find)
if(this.options.raw) { if(this.options.raw) {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!