0

Hey I am working on task reminder application where users can collaborate and complete tasks (something like trello).

I have tables - users, avatars, tasks, collaborators.

I actaully need to render collab requests sent by other users. Something like this. here see the collab request

I want to do joins so that I can get images of users.

I am able to get all the data except user avatar from avatar table.

Iam using active storage to store images

I am performing joins like this

   @collab_requests = Task.joins(:user, :collaborators)
.select("collaborators.id, tasks.id as taskId, tasks.title, tasks.end_date, users.full_name, users.avatar_id")
.where("collaborators.user_id = 3")

Have a look at my database

enter image description here

Pavan Kumar V
  • 592
  • 6
  • 17

0 Answers0