The has_one relationship here requires the idea table to have a competition_id column, which is not the case. I have tried that. Regarding the :winner, the column that links the idea is idea_id but saying belong_to :winner will not save the changes when you assign a winner-idea.
To clarify that last point:
competition.winner = Idea.first
competition.save
-- Close the console and reopen
competition.winner
=> nil

Please correct me if I am wrong