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
Use model names not singularised table names pt1
Use model names not singularised table names pt2