By using candidate.openings, you can avoid the transaction code here, since @candidate.save will auto-update the table.