In my rails appI have four models( say A, B, C, D, E and F)
- A belongs to B
- B has many Cs
- C belongs to D
- D belongs to E and F
I am trying to build query as follows
scope = A.joins(:b, { b: [:cs, {cs: [:d, {d: [:e,:f] } ] } ] }) But it is not working. The error message is schema cs (plural of c) does not exist.
I am using Postgresql.
joins(:c)thenjoins(:d)