as above you write code here.. which rails provides us. Let me tell you it is not wrong what you do.. it is just not needed. This is something I did wrong in the beginnings as well.

Please have look how associations in rails work:
http://guides.rubyonrails.org/association_basics.html