I am quite new to Rails and I am reading AWDwR. I am at Task E “Check
Out!”. I understand it quite well, but I have a problem with the last
playground exercise: Add a Table which contains the payment types.
All goes well, but I am not sure whether I should use has_many or
has_one(as in the Playground wiki at
I use the following:
class Order < ActiveRecord::Base
class PayType < ActiveRecord::Base
Is this right?
Or should I use has_one instead of belongs_to in Order? An order
references to one PayType, Order has one PayType.
I am confused, please help me.