Skip to content

Commit

Permalink
Merge pull request #1600 from alxndrsn/min-max-error-clarification
Browse files Browse the repository at this point in the history
Add more info to error messages when using min/max as column names
  • Loading branch information
rachaelshaw committed Apr 30, 2019
2 parents 3080fb5 + 18ff235 commit f1fd3f8
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions lib/waterline/utils/query/private/normalize-criteria.js
Expand Up @@ -239,6 +239,9 @@ module.exports = function normalizeCriteria(criteria, modelIdentity, orm, meta)
'usage has changed. Now, to run aggregate queries using the `groupBy` operator, '+
'use a native query instead.\n'+
'\n'+
'Alternatively, if you are using `groupBy` as a column/attribute name then '+
'please be advised that some things won\'t work as expected.\n'+
'\n'+
'For more info, visit:\n'+
'http://sailsjs.com/docs/upgrading/to-v1.0'
);
Expand All @@ -265,6 +268,9 @@ module.exports = function normalizeCriteria(criteria, modelIdentity, orm, meta)
' // ...'+'\n'+
'});'+'\n'+
'```\n'+
'Alternatively, if you are using `sum` as a column/attribute name then '+
'please be advised that some things won\'t work as expected.\n'+
'\n'+
'For more info, see:\n'+
'http://sailsjs.com/docs/reference/waterline-orm/models/sum'
);
Expand All @@ -288,6 +294,9 @@ module.exports = function normalizeCriteria(criteria, modelIdentity, orm, meta)
' // ...'+'\n'+
'});'+'\n'+
'```\n'+
'Alternatively, if you are using `average` as a column/attribute name then '+
'please be advised that some things won\'t work as expected.\n'+
'\n'+
'For more info, see:\n'+
'http://sailsjs.com/docs/reference/waterline-orm/models/avg'
);
Expand Down Expand Up @@ -322,6 +331,9 @@ module.exports = function normalizeCriteria(criteria, modelIdentity, orm, meta)
' }'+'\n'+
'});'+'\n'+
'```\n'+
'Alternatively, if you are using `min` as a column/attribute name then '+
'please be advised that some things won\'t work as expected.\n'+
'\n'+
'For more info, see:\n'+
'http://sailsjs.com/docs/reference/waterline-orm/models/find'
);
Expand Down Expand Up @@ -356,6 +368,9 @@ module.exports = function normalizeCriteria(criteria, modelIdentity, orm, meta)
' }'+'\n'+
'});'+'\n'+
'```\n'+
'Alternatively, if you are using `max` as a column/attribute name then '+
'please be advised that some things won\'t work as expected.\n'+
'\n'+
'For more info, see:\n'+
'http://sailsjs.com/docs/reference/waterline-orm/models/find'
);
Expand Down

0 comments on commit f1fd3f8

Please sign in to comment.