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

Commit 0fd9d331 by Jan Aagaard Meier

removed if DAO in mixin

1 parent e564c59d
Showing with 10 additions and 13 deletions
...@@ -10,10 +10,9 @@ Mixin.hasOne = function(associatedDAO, options) { ...@@ -10,10 +10,9 @@ Mixin.hasOne = function(associatedDAO, options) {
// the id is in the foreign table // the id is in the foreign table
var association = new HasOne(this, associatedDAO, Utils._.extend((options||{}), this.options)) var association = new HasOne(this, associatedDAO, Utils._.extend((options||{}), this.options))
this.associations[association.associationAccessor] = association.injectAttributes() this.associations[association.associationAccessor] = association.injectAttributes()
if (this.DAO) {
association.injectGetter(this.DAO.prototype); association.injectGetter(this.DAO.prototype);
association.injectSetter(this.DAO.prototype); association.injectSetter(this.DAO.prototype);
}
return this return this
} }
...@@ -22,10 +21,10 @@ Mixin.belongsTo = function(associatedDAO, options) { ...@@ -22,10 +21,10 @@ Mixin.belongsTo = function(associatedDAO, options) {
// the id is in this table // the id is in this table
var association = new BelongsTo(this, associatedDAO, Utils._.extend((options||{}), this.options)) var association = new BelongsTo(this, associatedDAO, Utils._.extend((options||{}), this.options))
this.associations[association.associationAccessor] = association.injectAttributes() this.associations[association.associationAccessor] = association.injectAttributes()
if (this.DAO) {
association.injectGetter(this.DAO.prototype); association.injectGetter(this.DAO.prototype);
association.injectSetter(this.DAO.prototype); association.injectSetter(this.DAO.prototype);
}
return this return this
} }
...@@ -33,10 +32,9 @@ Mixin.hasMany = function(associatedDAO, options) { ...@@ -33,10 +32,9 @@ Mixin.hasMany = function(associatedDAO, options) {
// the id is in the foreign table or in a connecting table // the id is in the foreign table or in a connecting table
var association = new HasMany(this, associatedDAO, Utils._.extend((options||{}), this.options)) var association = new HasMany(this, associatedDAO, Utils._.extend((options||{}), this.options))
this.associations[association.associationAccessor] = association.injectAttributes() this.associations[association.associationAccessor] = association.injectAttributes()
if (this.DAO) {
association.injectGetter(this.DAO.prototype); association.injectGetter(this.DAO.prototype);
association.injectSetter(this.DAO.prototype); association.injectSetter(this.DAO.prototype);
}
return this return this
} }
......
...@@ -253,7 +253,6 @@ module.exports = (function() { ...@@ -253,7 +253,6 @@ module.exports = (function() {
DAO.prototype.addAttribute = function(attribute, value) { DAO.prototype.addAttribute = function(attribute, value) {
this[attribute] = value this[attribute] = value
// this.attributes.push(attribute)
} }
DAO.prototype.setValidators = function(attribute, validators) { DAO.prototype.setValidators = function(attribute, validators) {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!