Skip to content

Commit

Permalink
Move variable declaration to top of scope
Browse files Browse the repository at this point in the history
  • Loading branch information
elliotf committed Nov 20, 2013
1 parent 6f5a408 commit d179778
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions lib/dialects/postgres/query-generator.js
Original file line number Diff line number Diff line change
Expand Up @@ -145,10 +145,13 @@ module.exports = (function() {
},

arrayValue: function(value, key, _key, factory){
var col = null
, coltype = null
, _realKey = key.split('.').pop()

if (value.length === 0) { value = [null] }
var col = null, coltype = null

// Special conditions for searching within an array column type
var _realKey = key.split('.').pop()
if (!!factory && !!factory.rawAttributes[_realKey]) {
col = factory.rawAttributes[_realKey]
coltype = col.type
Expand Down

0 comments on commit d179778

Please sign in to comment.