I was using Ryan Bates\'s source code for railscasts #141 in order to create a simple shopping cart. In one of the migrations, he lists
class CreateProducts
The t.belongs_to :category is just a special helper method of rails passing in the association.
t.belongs_to :category
If you look in the source code belongs_to is actually an alias of references
belongs_to
references