I have two models which have tables in my rails app (board and payment). I want to know which boards have a payment associated with them. Right now I have a has_one and belongs_to association setup between a payment and a board where the foreign key is a board_id in my payments table. So the payment belongs_to a board and a board has_one payment.
I want to get all of the board objects that have a payment ID associated with them. I know I can accomplish this by making a call to the payments table to get all the payments that have a board ID and then query for those boards, but I want to do this in one DB query. Is that possible? If so what does that query look like in rails?