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

Commit a72daaed by Thaddeus Quintin

instances weren't using the getTableName function. They should\!

1 parent 4b0171b2
Showing with 4 additions and 4 deletions
...@@ -551,7 +551,7 @@ module.exports = (function() { ...@@ -551,7 +551,7 @@ module.exports = (function() {
if (self.isNewRecord) { if (self.isNewRecord) {
query = 'insert'; query = 'insert';
args = [self, self.QueryInterface.QueryGenerator.addSchema(self.Model), values, options]; args = [self, self.Model.getTableName(options), values, options];
hook = 'Create'; hook = 'Create';
} else { } else {
var identifier = self.primaryKeyValues; var identifier = self.primaryKeyValues;
...@@ -572,7 +572,7 @@ module.exports = (function() { ...@@ -572,7 +572,7 @@ module.exports = (function() {
} }
query = 'update'; query = 'update';
args = [self, self.QueryInterface.QueryGenerator.addSchema(self.Model), values, identifier, options]; args = [self, self.Model.getTableName(options), values, identifier, options];
hook = 'Update'; hook = 'Update';
} }
...@@ -733,7 +733,7 @@ module.exports = (function() { ...@@ -733,7 +733,7 @@ module.exports = (function() {
} else { } else {
where = {}; where = {};
where[self.Model.rawAttributes[self.Model.primaryKeyAttribute].field] = self.get(self.Model.primaryKeyAttribute, {raw: true}); where[self.Model.rawAttributes[self.Model.primaryKeyAttribute].field] = self.get(self.Model.primaryKeyAttribute, {raw: true});
return self.QueryInterface.delete(self, self.QueryInterface.QueryGenerator.addSchema(self.Model), where, _.defaults(options, {limit: null})); return self.QueryInterface.delete(self, self.Model.getTableName(options), where, _.defaults(options, {limit: null}));
} }
}).tap(function(result) { }).tap(function(result) {
// Run after hook // Run after hook
...@@ -841,7 +841,7 @@ module.exports = (function() { ...@@ -841,7 +841,7 @@ module.exports = (function() {
countOrOptions.attributes[updatedAtAttr] = this.Model.__getTimestamp(updatedAtAttr); countOrOptions.attributes[updatedAtAttr] = this.Model.__getTimestamp(updatedAtAttr);
} }
return this.QueryInterface.increment(this, this.QueryInterface.QueryGenerator.addSchema(this.Model), values, where, countOrOptions); return this.QueryInterface.increment(this, this.Model.getTableName(countOrOptions), values, where, countOrOptions);
}; };
/** /**
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!