Skip to content

Associated objects #138

@RajRoR

Description

@RajRoR
> 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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions