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

Commit d965119a by Jan Aagaard Meier

🔥 Remove ununsed arrayValues func in QG. Remove getAssociationByAlias in mixin.js

1 parent 20558a57
...@@ -374,17 +374,3 @@ Mixin.getAssociation = function(target, alias) { ...@@ -374,17 +374,3 @@ Mixin.getAssociation = function(target, alias) {
return null; return null;
}; };
Mixin.getAssociationByAlias = function(alias) {
for (var associationName in this.associations) {
if (this.associations.hasOwnProperty(associationName)) {
var association = this.associations[associationName];
if (association.as === alias) {
return association;
}
}
}
return null;
};
...@@ -2159,14 +2159,6 @@ module.exports = (function() { ...@@ -2159,14 +2159,6 @@ module.exports = (function() {
return joins; return joins;
}, },
arrayValue: function(value, key, _key, factory, logicResult) {
var _value = null;
if (value.length === 0) { value = [null]; }
_value = '(' + value.map(function(v) { return this.escape(v); }.bind(this)).join(',') + ')';
return [_key, _value].join(' ' + logicResult + ' ');
},
booleanValue: function(value) { booleanValue: function(value) {
return value; return value;
} }
......
...@@ -189,36 +189,6 @@ module.exports = (function() { ...@@ -189,36 +189,6 @@ module.exports = (function() {
}); });
}, },
arrayValue: function(value, key, _key, factory, logicResult) {
var col = null
, coltype = null
, _realKey = key.split('.').pop().replace(/"/g, '')
, _value;
if (value.length === 0) { value = [null]; }
// Special conditions for searching within an array column type
if (!!factory && !!factory.rawAttributes[_realKey]) {
col = factory.rawAttributes[_realKey];
coltype = col.type;
if (coltype && typeof coltype !== 'string') {
coltype = coltype.toString();
}
}
if (col && ((!!coltype && coltype.match(/\[\]$/) !== null) || (col.toString().match(/\[\]$/) !== null))) {
_value = 'ARRAY[' + value.map(this.escape.bind(this)).join(',') + ']::' + (!!col.type ? col.type : col.toString());
if (logicResult === 'IN') {
logicResult = '=';
}
return [_key, _value].join(' ' + logicResult + ' ');
} else {
_value = '(' + value.map(this.escape.bind(this)).join(',') + ')';
return [_key, _value].join(' ' + logicResult + ' ');
}
},
removeColumnQuery: function(tableName, attributeName) { removeColumnQuery: function(tableName, attributeName) {
var query = 'ALTER TABLE <%= tableName %> DROP COLUMN <%= attributeName %>;'; var query = 'ALTER TABLE <%= tableName %> DROP COLUMN <%= attributeName %>;';
return Utils._.template(query)({ return Utils._.template(query)({
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!