Fix(queryGenerator#quote): `as` variable
var declarations moved out of loop
association.through not always defined
Merge pull request #2485 from overlookmotel/bug-fix-quote

Fix(queryGenerator#quote): `as` variable