Skip to content

Commit

Permalink
doing an in check on indexedProperties is stupid -- testing for truth…
Browse files Browse the repository at this point in the history
…y value is more robust
  • Loading branch information
dlandolt committed Feb 9, 2010
1 parent c992481 commit cb93518
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/store/sql.js
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ exports.SQLStore = function(config){
}
sortAttribute = sortAttribute.substring(1);
}
if(!sortAttribute in indexedProperties){
if(!indexedProperties[sortAttribute]){
throw new URIError("Can only sort by " + Object.keys(indexedProperties));
}
sql += " " + config.table + "." + sortAttribute + " " + orderDir + ",";
Expand Down Expand Up @@ -143,7 +143,7 @@ exports.SQLStore = function(config){
throw new URIError("Invalid query syntax, unknown type");
}
function addClause(name, sqlClause){
if(!name in indexedProperties){
if(!indexedProperties[name]){
throw new URIError("Can only query by " + Object.keys(indexedProperties));
}
if(sql){
Expand Down

0 comments on commit cb93518

Please sign in to comment.