2
I want to do in ruby on Rails, this:
SELECT * FROM isolateds
INNER JOIN genes ON geness.isolated_id = isolateds.id
INNER JOIN stats ON stats.gene_id = genes.id
INNER JOIN mutations ON stats.mutation_id = mutations.id
When I do:
Isolated.joins(:genes).all
, the result is:
SELECT * FROM isolateds
INNER JOIN genes ON geness.isolated_id = isolateds.id
But when I do,
Isolated.joins(:genes, :stats).all
, make a mistake and I can’t even get to the mutations table, what I’m doing wrong?