I have two tables A(:id, :random) and B(:id, :flag). I need to do an inner join of A with B on :id and output only those records whose B.flag is true. I wrote a query like this :
A.joins(b).where(:flag => 'true')
But this translates to A.flag whereas I need B.flag
What should be the correct query?