Guest User

Untitled

a guest
Jul 16th, 2018
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.22 KB | None | 0 0
  1. result = A.joins("INNER JOIN B B1 ON A.id = B1.A_id")
  2. .joins("INNER JOIN B B2 on A.id = B2.A_id")
  3. .where("B1.key" => "B1", "B2.key" => "B2")
  4.  
  5. result.map {|res|
  6. A = res.A
  7. B1 = res.B1
  8. B2 = res.B2
  9. }
Add Comment
Please, Sign In to add comment