{"action":"closed","issue":{"url":"https://api.github.com/repos/sequelize/sequelize/issues/4849","labels_url":"https://api.github.com/repos/sequelize/sequelize/issues/4849/labels{/name}","comments_url":"https://api.github.com/repos/sequelize/sequelize/issues/4849/comments","events_url":"https://api.github.com/repos/sequelize/sequelize/issues/4849/events","html_url":"https://github.com/sequelize/sequelize/issues/4849","id":116603111,"number":4849,"title":"'$' on nested wheres","user":{"login":"schuetta92","id":6557713,"avatar_url":"https://avatars.githubusercontent.com/u/6557713?v=3","gravatar_id":"","url":"https://api.github.com/users/schuetta92","html_url":"https://github.com/schuetta92","followers_url":"https://api.github.com/users/schuetta92/followers","following_url":"https://api.github.com/users/schuetta92/following{/other_user}","gists_url":"https://api.github.com/users/schuetta92/gists{/gist_id}","starred_url":"https://api.github.com/users/schuetta92/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/schuetta92/subscriptions","organizations_url":"https://api.github.com/users/schuetta92/orgs","repos_url":"https://api.github.com/users/schuetta92/repos","events_url":"https://api.github.com/users/schuetta92/events{/privacy}","received_events_url":"https://api.github.com/users/schuetta92/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/sequelize/sequelize/labels/bug","name":"bug","color":"d7e102"}],"state":"closed","locked":false,"assignee":{"login":"mickhansen","id":699049,"avatar_url":"https://avatars.githubusercontent.com/u/699049?v=3","gravatar_id":"","url":"https://api.github.com/users/mickhansen","html_url":"https://github.com/mickhansen","followers_url":"https://api.github.com/users/mickhansen/followers","following_url":"https://api.github.com/users/mickhansen/following{/other_user}","gists_url":"https://api.github.com/users/mickhansen/gists{/gist_id}","starred_url":"https://api.github.com/users/mickhansen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mickhansen/subscriptions","organizations_url":"https://api.github.com/users/mickhansen/orgs","repos_url":"https://api.github.com/users/mickhansen/repos","events_url":"https://api.github.com/users/mickhansen/events{/privacy}","received_events_url":"https://api.github.com/users/mickhansen/received_events","type":"User","site_admin":false},"milestone":null,"comments":1,"created_at":"2015-11-12T17:47:22Z","updated_at":"2015-11-27T12:00:12Z","closed_at":"2015-11-27T12:00:12Z","body":"```\r\ndb.Spectrum.findAll({\r\n  include: [\r\n    {\r\n      model: db.Varietal,\r\n      include : [\r\n        {\r\n          model : db.Wine\r\n        }\r\n      ]\r\n    }\r\n  ],\r\n  where: {\r\n    '$Varietals.Wines.restaurant_id$': restaurant_id,\r\n    '$Varietals.Wines.owner_id$': null\r\n  },\r\n  group : ['specID']\r\n});\r\n```\r\n\r\nThis query should produce a where statement that looks like \r\n\r\n```\r\nWHERE `Varietals.Wines`.`restaurant_id` = 16\r\n```\r\n\r\nbut instead produces\r\n\r\n```\r\nWHERE `Varietals`.`Wines`.`restaurant_id` = 16\r\n```\r\n\r\nWhich gives an invalid column error. "}}