Apply extract method to condition

This commit is contained in:
Daniel García Aubert 2017-09-14 16:56:55 +02:00
parent 1f3b0beddf
commit 51907b9545

View File

@ -236,7 +236,7 @@ module.exports = class Aggregation extends BaseDataview {
override = {};
}
if (this.aggregationColumn && this._isFloatColumn === null) {
if (this._shouldCheckColumnType()) {
this._isFloatColumn = false;
this.getColumnType(psql, this.aggregationColumn, this.queries.no_filters, function (err, type) {
if (!err && !!type) {
@ -266,6 +266,10 @@ module.exports = class Aggregation extends BaseDataview {
return callback(null, aggregationSql);
}
_shouldCheckColumnType () {
return this.aggregationColumn && this._isFloatColumn === null;
}
format (result) {
const {
count = 0,