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

Pass join parameters on assoc #67

Closed
cuongkta opened this issue Nov 12, 2016 · 1 comment
Closed

Pass join parameters on assoc #67

cuongkta opened this issue Nov 12, 2016 · 1 comment

Comments

@cuongkta
Copy link

I have the issue like this ecto's issue with phoenix_ecto:
elixir-ecto/ecto#1678

Pls advise. How to use 'on' query with paramater

from i in query,
left_join: v in assoc(i, :votes)
on: v.user_id = ^user_id

How to make it works ?

@josevalim
Copy link
Member

You need a comma after the second expression:

from i in query,
left_join: v in assoc(i, :votes),
on: v.user_id = ^user_id

Also please use the mailing list or StackOverflow for questions/help, where a wider community will be able to help you. We reserve the issues tracker for issues only. Thank you!

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

No branches or pull requests

2 participants