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

Associated objects #138

Open
RajRoR opened this issue Aug 27, 2014 · 0 comments
Open

Associated objects #138

RajRoR opened this issue Aug 27, 2014 · 0 comments

Comments

@RajRoR
Copy link

RajRoR commented Aug 27, 2014

> Issue.where(["project IN (?)", current_user.projects])
>> *** TypeError Exception: can't convert Array into Hash

Model associations

  1. user has_many projects
  2. project has_many issues

My goal is to get all issues related to an user through his projects. I tried using 'OR' condition but again, it was unsuccessful as the where needs only hash.

Can you guide me to to achieve the goal using minimum API calls?

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

1 participant