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
, give me an error and I can not get to the table mutations, what am I doing wrong?