Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

'$' on nested wheres #4849

Closed
ashleyschuett opened this issue Nov 12, 2015 · 1 comment
Closed

'$' on nested wheres #4849

ashleyschuett opened this issue Nov 12, 2015 · 1 comment
Assignees

Comments

@ashleyschuett
Copy link

db.Spectrum.findAll({
  include: [
    {
      model: db.Varietal,
      include : [
        {
          model : db.Wine
        }
      ]
    }
  ],
  where: {
    '$Varietals.Wines.restaurant_id$': restaurant_id,
    '$Varietals.Wines.owner_id$': null
  },
  group : ['specID']
});

This query should produce a where statement that looks like

WHERE `Varietals.Wines`.`restaurant_id` = 16

but instead produces

WHERE `Varietals`.`Wines`.`restaurant_id` = 16

Which gives an invalid column error.

@mickhansen mickhansen self-assigned this Nov 12, 2015
@mickhansen
Copy link
Contributor

It was intended this way, but i'm not sure why, maybe schemas

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants